获取每个工作表Excel库的列数

时间:2014-01-14 13:47:20

标签: c# excellibrary

我正在使用ExcelLibrary包。想知道如何确定每张工作表的列数?。

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

}

1 个答案:

答案 0 :(得分:1)

尝试

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

}