Home » excel » c# – Row count with SpreadsheetLight

c# – Row count with SpreadsheetLight

Posted by: admin March 9, 2020 Leave a comment


I’m looking for a function similar to DataTable.Rows.Count that can be used with an SLDocument to find out how many rows have data in them. Is there something available in SpreadsheetLight? Any other methods of achieving this?


How to&Answers:
SLWorksheetStatistics stats1 = firstdoc.GetWorksheetStatistics();

for (int j = 1; j < stats1.EndRowIndex; j++)
    var value = firstdoc.GetCellValueAsString(0, j)  ;