C#: Getting the number of rows/columns with ExcelPackage

后端 未结 9 757
执念已碎
执念已碎 2021-02-03 18:59

I need to read and write data from an Excel spreadsheet. Is there a method to finding out how many rows/columns a certain worksheet has using ExcelPackage? I have the following

9条回答
  •  甜味超标
    2021-02-03 19:41

    The best way to get the total of rows and columns is with these methods:

    int col = sheet.Dimension.Columns;
    int row = sheet.Dimension.Rows;
    

提交回复
热议问题