负值的Epplus工程图

时间:2018-06-19 13:22:45

标签: c# excel epplus

我正在使用EPPlus打开excel文件,问题是当我打开文件时,WorkSheet中有多个ExcelDrawing。Drawings的“ To”属性值为负。

To.Column = -2147483648 
To.ColumnOff = -2147483648 
To.Row = -2147483648 
To.RowOff = -2147483648

任何人都知道如何解决此问题?

代码:

using (ExcelPackage pack = new ExcelPackage(new FileInfo(@"C:\Files\test.xlsm")))
{
   foreach (ExcelWorksheet ws in pack.Workbook.Worksheets)
   {
       foreach (ExcelDrawing drw in ws.Drawings)
       {
           if (drw.To.Column > ExcelPackage.MaxColumns || drw.To.Column < 1)
           {

               Console.WriteLine(ws.Name + "|" + drw.Name);
           }
      }
   }
   pack.Save();
}

0 个答案:

没有答案