Free Support Forum - aspose.com

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

Excel excel1=new Excel();
excel1.Open(“E:\test.xls”);
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();
excel3.OpenCSV(“E:\SHEETWIP.CSV”);
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.