Is this an issue with the Excel ReadRange Activity, or is this how it works?

I have an Excel with a gazillion columns, but only 300 or so rows.
I don’t want to read the entire width of the excel because:

  1. Too much data is read in just to get the row count
  2. I need all the data in just the first 3 columns from range “A3:C3” to do all the processing

But here’s the catch:
When I gave it a range A3:C3 and then read the row count, it came back with Zero!

Okay? So I changed the range to “A3:C1048576”. Where 1048576 is the maximum allowable rows in modern Excel.

But when I ran the row count again, it came back with this!

But, I was expecting around 300 rows.

Question: Shouldn’t the ReadRange give me only populated rows?

Now I have to load a large worksheet into memory just to get the row count.

But is this something that UiPath can implement as an activity? Maybe just load data from one column and get a row count?

I do have another idea on how to do this without loading the entire worksheet, but haven’t tried it out yet. Will update this post if I do.


Ok, this works. And it’s limited to only those documents that have column names.

First I load only data for one column (and included the column name) using this Read Range into a DataTable called dtLookUps


And then I run a Select on the resulting data table as follows:

dtLookUps.Select("[Reference #] <> ''" ).Count()

Unfortunately the column names have symbols like # and therefore I have to put brackets around the column name in the Select clause.

This time it comes back with the right count which is correct!