This project has moved and is read-only. For the latest updates, please go here.

SaveAs InvalidOperationException

Jan 11, 2013 at 6:11 PM
Edited Jan 11, 2013 at 6:46 PM

I have a file where EPPlus.dll v3.1.2.0 throws "InvalidOperationException: Index was outside the bounds of the array"on the SaveAs line in the example code below:

string _sFile = "test.xlsm";
using (FileStream stream = File.Open(_sFile, FileMode.Open, FileAccess.ReadWrite))
    using (ExcelPackage ep = new ExcelPackage((stream)))
        String newFilename = _sFile + ".modified.xlsm";
        FileInfo fi = new FileInfo(newFilename);

I don't see how to attach this file at the moment, as has been done in this post: