Read Range activity - Excel


I have a doubt about read range activity. By default, new excel sheet in Excel 2019 will have 1,048,576 rows. Assuming only 5 rows have data, when we use read range activity, how many rows will the activity read? all 1,048,576 or only 5 rows. Because if we use datatable.Rows.Count activity, it gives me just 5 rows as count. If it reads all 1,048,576 rows, it is waste of execution time and memory.

Also is there any way to find actual number of rows having records even before extracting excel data to data table?


It will consider till the last row which is containing data.


Thanks Mahesh for the quick response. It means, not all 1,048,576 rows will be read, Read Range activity internally identifies the actual last row with records and not go through remaining empty rows without wasting the memory and execution time right?


Yes it read rows till the data but not whole file.