Value of datatable rowscount> existing data in excel

Excel has 100 rows of data but after reading data and getting rows count , the value of datatable.rowscount> existing data in excel .

which activity are using to read the data is it excel or workbook?

Hi @aaravsharma_dsc

Could you be more specific. I couldn’t understand what your query is…?

i am using workbook activities to read the data and store in DT

i have 10 rows in excel say
but when i use msgbox it shows 12 rows count of rows

Hi in that case u might be reading filtered data and hidden data
use this

now will get rowcount and actual count of rows as equal @aaravsharma_dsc

@aaravsharma_dsc
you can use the debugging panels e.g. the immediate panel and check the resulting datatable e.g. by

YourDataTableVar
YourDataTableVar.Rows.Count
YourDataTableVar.AsEnumerable.Last().ItemArray

Maybe there are rows with blank (Spaces) values at the end

@aaravsharma_dsc

Mostly when reading data from excel even if there is space or if data was filled and just removed but rows are not deleted then those are also read as rows with data

Onw way to over come is to correct the excel by completely removing

Another is to read dtaa and then filter data to remove empty rows by filter dtaatable

Both of the above should be working

Cheerd

Hi @Anil_G i dont have the empty rows in the excel , i am actually reading the hidden data / filtered data as read workbook by deault reads the whole data and doesnt consider the filters .
as suggested i have used modren excel activities now and used proprty true - visible rows only and able now get correct rwcount and excel data

appreciate @sandyarpa767 for the workaround

1 Like

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