No Row At Position 0

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
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).

Variable - String - ExtractAndSave: ExtractDataTable.Rows(0).Item(0).ToString

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.

It is saying there is no row in your Data table variable…can you check in log message their is any row present… By this expression


Check before getting first row first cell value.

If their data is present it will give you data.

I believe your DataTable is Empty

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.

Thank you for the replies.

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.

Put a log message/mesaage box activity just after where you are Scrapping table from application


I gave just examples for understanding how we can check rows in table, I know read excel file is not related to you.

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

Also tried setting the variable using this expression: PTDataTable.rows(0).item(0).ToString

@EarlA Can you show us Excel file first row.

I am scraping the first 5 rows, this is from the Excel file


You’re not extracting into ExtractDatatable, your variable is PTDataTable. So you need to do PTDataTable.Rows(0).Item(0).ToString

I do recommend using column names though. More reliable.

PTDataTable.Rows(0)(“Column Name”).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.

1 Like

@EarlA Please close this thread by marking suitable solution Thanks

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.