Problem with Cells.Rows.Count

Hi ,

I am using aspose Excel for uploading the excel file and converting the data into database.

First time in excel file i entered 10 rows so cells.Rows.count return 10 it's working fine.

Second time i used the same excel file i deleted 10 Rows and entered 5 Rows this time alos

cell.Rows.Count returns 10.but i need 5 only.how can i solve this problem?

Rows collection includes row settings so its count may be more than rows containing data. Please try to use Cells.MaxDataRow.