Copy from Excel and Paste into Accounting Software, then print

Hi All,

Hoping you can help. I am trying to paste from excel an invoice number and paste it into an accounting system and then print it and then repeat the process.

I am a major rookie, tried doing it myself and failed hopelessly. Tried searching on here for a solution, even one that is close to what i need (but cant seem to find it) and try adapt it.

Many Thanks in advance

Use a Read Range activity to read the data in Excel and put it into a datatable. Then use a For Each Row activity to perform actions for each row of data. Inside of the For Each Row loop and assuming the Excel spreadsheet is one column, you can send the data in the cell to the field using a Set Text activity, and set the text to row(0).ToString. Then use a Write Line activity to write row(0).ToString to the screen.

Hi Anthony - wow that was quick! Thanks. Unfortunately the excel spreadsheet has multiple columns and i only need to look at one of them.

I have attached a copy of the excel sheet. Excuse my noviceness but what would the Variable be that i would need to create in the for each i.e. VB expression

I have also attached the flow so far.
Book1.xlsx (32.7 KB)
Main.xaml (5.0 KB)

For security reason i have removed the links to the attached excel sheet from the flow.


Hi @Chad_Barnes

Use read range and pass the excel path and give the datatable and then use for each row activity and whithin that you can give pass the accounting software webpage and check it

Ashwin S

I’ve modified your Main.xaml file to show what I mean for reading the table. I’m assuming you want column K containing the ‘doc’, but this can be changed if needed.

Main.xaml (6,2 Ko)

@Anthony_Humphries thank you very much. I am truly grateful. You are also correct it was the “doc” column i needed to reference. I have put the set text activity in with the row(0).ToString. I have also put in a do while to create the loop - is this correct?

Also put the write line activity in to. Perhaps i put it in the wrong place?

@AshwinS2 how would i link it to the accounting software exactly?

Main.xaml (7.9 KB)

You won’t need a Do While, since the For Each Row iterates over each doc field already. Also, don’t put row(0).ToString in quotes. You’ll also need to set up your selector for the website by using the “Indicate On Screen” button in the activity. The selector may need to be modified after that, but there are cases where no other update is needed.

Thanks @Anthony_Humphries Made those changes.

Hit a snag…I dont think the “Indicate on screen” activity will fit what i need it to do. Updated flow attached

Once the bot has selected the number that needs printing it needs to navigate to the accounting software (through multiple double clicks) to get to the area it needs to paste that selected number in.

i.e. click on “accounts heading”>>accounts sub heading>>Payables>>Enquiries>>Invoice Register Enquiry>>Put in text “GAPINV” in a box then put the selected number in a different box>>Press green tick button>>click image button>>select pop up window>>ctrl+p (print)

I was hoping i could use the “record” function to record the above path. Can this be done?

Main.xaml (8.5 KB)

You can use the record function, but you’ll need to take what it outputs and paste it in the appropriate part of your workflow. Any activities performed only once before the process begins should come before the loop starts. Anything that is done repetitively should be in the For Each loop. Make sure that the state of the page is the same at the beginning of the loop every time. If this means clicking buttons to get back to a main screen, make sure to do this in the loop.

@Anthony_Humphries will work on it now. Thank you

HI @Anthony_Humphries thank you for your time on this.

At present i am stuck on the paste and print section of this bot. Unfortunately i cannot share this section of the flow as it linked to company software and therefore not allowed to.

Do we not perhaps a template flow that follows the whole copy (from excel), paste (in software programme) and then print and repeat?

Copying from Excel is normally done by using a Read Range activity, and pasting the data is done with Write Range. UiPath is built to use the Excel application directly as little as possible to reduce errors. Datatables are stable and do not rely on the UI to be processed.

Essentially, once you have a workflow for reading the data in an writing it, it can be reused elsewhere if needed.