SaveAs InvalidOperationException

Jan 11, 2013 at 5:11 PM
Edited Jan 11, 2013 at 5: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);
        ep.SaveAs(fi);
    }
}

I don't see how to attach this file at the moment, as has been done in this post: http://epplus.codeplex.com/workitem/14710.