Search code examples
c#excellibrary

getting column count per work sheet Excell Library


I am using the ExcelLibrary package. Was wondering how to determine the amount of columns per work sheet?.

var workbook = Workbook.Load(fileToValidate);
foreach (var v in workbook.Worksheets)
{
     //coulmn count for each sheet

}

Solution

  • Try

    var workbook = Workbook.Load(fileToValidate);
    foreach (var v in workbook.Worksheets)
    {
         //coulmn count for each sheet
         int count = v.Columns.Count();
    
    }