2

I'm trying to save a file using EPPlus, but I keep getting an InvalidOperationException on the Save() line.

System.IO.File.Copy(strSource, strNewNotePath, true);
ExcelPackage xlPackage = new ExcelPackage(new FileInfo(strNewNotePath));
xlPackage.Save();

The InnerException says "Index was out of range. Must be non-negative and less than the size of the collection.\r\nParameter name: index".

The Excel file has very little in it - just a few drawing items really - rounded rectangles, textboxes, and then two cells with some data in them.

Anyone got any ideas what could be causing this?

Thanks

4

1 回答 1

0

我在 EPPlus 的 3.0.0.2 版本中遇到了同样的问题。我尝试创建新的 excel 文件,重新保存现有的文件,但没有奏效。我得到了最新版本(截至 20141016 (3.1.3.0)),它运行良好。

于 2014-10-16T10:40:56.593 回答