Excel number of rows
-
Hi, I'm trying to read an Excel spreadsheet that contains a variable amount of data, names, address, etc. I will always have columns A-Z, but the number of rows will change. I'm trying to determine the last row in the spreadsheet that contains data. I've tried this code, but it returns a very large number:
public int GetNumberOfRows( )
{
if (excelWorksheet == null)
return (-1);return (excelWorksheet.Rows.Count); }
Any help is greatly appreciated.
Glenn
-
Hi, I'm trying to read an Excel spreadsheet that contains a variable amount of data, names, address, etc. I will always have columns A-Z, but the number of rows will change. I'm trying to determine the last row in the spreadsheet that contains data. I've tried this code, but it returns a very large number:
public int GetNumberOfRows( )
{
if (excelWorksheet == null)
return (-1);return (excelWorksheet.Rows.Count); }
Any help is greatly appreciated.
Glenn