I’m an experienced Excel VBA programmer but new to UiPath. I’m trying to build my first project after working through the 1.5 hour Anders Jensen intro.
I’m struggling with a “No Row At Position 0” message.
Main Sequence
Use Browser Firefox
Sequence
ExtractAndSave
Extract Table Data
Write Range Workbook
The above steps capture a table and write it to an xlsx file.
My problem occurs when I define a variable to extract the value from the first cell in the table (row 0, column 0) (I do not need to iterate the table for additional values).
The No Row At Position 0 error crops up as soon as I add the variable and run the project. Clearly, there is data because it is being successfully written.
Click the magnifying glass (search) icon all the way at the top right of the Studio window. Select Universal Search. Type in the name of your variable. I suspect you have defined the variable more than once, so you think you’re referencing the same variable but you’re not.
Reply #1; I have scanned the logs and see nothing which raises a red flag. I have no idea where to put “yourdt.Rows.Count.ToString”
Reply #2: This appears to involve reading the spreadsheet back into UiPath. I have no need for a spreadsheet.
Reply #3: I have just 6 variables declared and have verified that there are no duplicates.
I’ve just spent a couple of hours looking through documentation and everything appears to deal with export/import with spreadsheets. I have also rebuilt the process 3 times from scratch as described above. Everything works perfectly until I declare the variable which is to receive the cell value from the table.
I have proven the existance of the table and its contents by writing it to a spreadsheet. I don’t understand why I am unable to access the table data directly. Is the table not persistent until programatically destroyed or the process completes? I have no need for the spreadsheet other than to prove the data was scraped. .
Column 0 contains a time and column 1 a URL. All I want to do is work with the first couple of rows to find a time within bounds and then execute the corresponding URL to go to another page.
Find the activity right after Extract Table Data. Right-click it and select Toggle Breakpoint. Now run the process in Debug mode. It will pause on the breakpoint. When it pauses, you can look in the panel on the left and it’ll show all your variables and their values. Expand the ExtractDataTable variable and you’ll be able to see what, if any, data is in it.
I suspect your extract activity isn’t configured properly. These can be tricky. They can run without error but not pick up any data. Can you also post some screenshots showing your process top to bottom?
You can use Snipping Tool to take a screenshot then CTRL+V it directly into your reply here.
The image shows the 3 activity sequence including the Message Box as requested. The message box displays 5 (the row capture is limited to 5 rows) and the XLSX file is created.
I set a break point on the activity following the Extract (Message Box) and the ExtractDataTable variable contains the correct data.
The sequence fails when I add a variable to receive the contents of the first cell and use this expression: ExtractDataTable.Rows(0).Item(0).ToString
I did try that when I changed the table name (message above). I also tried using the column name as suggested.
Unlike regular line by line coding, UiPath is not giving me the ability to control when the variable value is set. I suspect that it is attempting to create the variable at the beginning of the sequence before the table has actually been created. That is the only scenario which makes any sense here.
My suspicion that UiPath was attempting to create the variable at the beginning of the sequence before the table has been created was correct. I added an If activity to the sequence which I used to work with the first and second cells in the table and it worked properly.
Just part of learning the ropes. I have managed to complete my first fully functional script. @raja.arslankhan and @postwick, thank you for your assistance.