megha_gambhire
12 years agoContributor
Incorrect Row count of Excel, if we delete few rows
I have used followign code to read row count from Excel.
var app = Sys.OleObject("Excel.Application");
var book = app.Workbooks.Open(fileName);
RowCount = app.ActiveSheet.UsedRange.Rows.Count
It works first time, for the records added in Excel.
Latter we removed few rows, then try to run the script
here it still displayed old row count, even though we now have less row count.
Any solution on this ?