Datatable row count is always less 1 than the actual number of rows

Hello there,

When I count the number of rows, I use Read Range activity to read the entire table, and then assign a variable to count rows using dt.Rows.Count.

What I am confused is when using Read Range and check “Add header”, the number of rows is the actual number of row minus 1.
Let’s say a table has 72 rows (including header), and if I check “Add header”, and count rows using Rows.Count, it shows 71.
If I uncheck “Add header”, the number of rows is 72.
This result is the same whether a table has header or not.

What does exactly “Add header” do when it comes to Rows.Count?

Add header is using the first row from excel as column names and applies it on the resulting datatable. This is reason of differences on the rows count

Totally understand.

Thank you so much.

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