Free Support Forum -

How to get the number of CSV sheet's rows?

Excel excel1=new Excel();
int test=excel1.Worksheets[“release”].Cells.Rows.Count;

I can get the number of xls file’s rows,but the following line did not work:

Excel excel3=new Excel();
int num=excel3.Worksheets[“SHEETWIP”].Cells.Rows.Count;

How to get the num?


You can use Cells.MaxRow - Cells.MinRow + 1 to get number of rows.