I am working through UIPath Acedemy’s “Using interface automation” section and have come across one example where an Excel workbook contains 5 rows of data. The video describes how to extract data from the first row and then populate the rightmost field with a transaction number. It does not show how to extract data from the additional rows and then populate each row with a transaction number. Could some body please point me in the direction how I can work through the remaining rows and then stop when I arrive at the last blank row?
Read Range to get the data into a datatable. Add what you need to the datatable. Then Write Range back to the Excel file.
Thank you for your response. I did find the “read range” and the “Write DataTable to Excel” activities. Here is some additional detail, which may yield an additional answer … I hope simplified.
The automation, which runs successfully for one row of the excel data uses the following activities:
Access a user interface with a “Use Application” Activity.
Uses a “use Excel File” activity to specify the Excel workbook used in the automation.
Uses a type into activity to extract a value from the Excel workbook (from Cell A2 - the data table has a header row).
Uses a “Click” activity to enter the value into the User Interface.
Uses a Get text activity to pull a transaction number from the interface and enter it into cell B2 of the Excel workbook.
So the first row of data has been extracted from Cell A2 and the transaction number has been entered into cell B2. I now would like the automation to start running through the same sequence of steps starting to extract data from the second row of the Excel workbook (A3) and then write the transaction number into cell B3. Then move to the next row and so on until there is no more data into the next Excel row. I hope this makes sense. Thank you in advance for your help.
Use the “For Each Excel Row” activity. Within this activity, you would use “Current Row” under For Each and then set your In range (using the + sign. My Excel has headers and I want it to save after each row, so make sure you check both boxes. Good Luck!
*Added note, make sure that all of your Type In form and Get Text activities are within your “For Each Excel Row” activity. (I wished I could paste a picture for you!
Thank you so much Susan! Much appreciated
Oh, that’s a really poor lesson then. Typically you don’t do things in Excel using UI automation (type into, click etc) - you use the Excel activities.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.