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

后端 未结 9 647
执念已碎
执念已碎 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:26

    You can get the row and column count using ExcelPackage (EPPlus.dll version 3.0.0.2) as below:

      var rowCnt = worksheet.Dimension.End.Row;
      var colCnt = worksheet.Dimension.End.Column;
    

提交回复
热议问题