This project has moved. For the latest updates, please go here.
2
Vote

'OfficeOpenXml.Packaging.Ionic.Zip.BadReadException' in EPPlus.dll

description

I am using EPPlus in VS to read in roughly 300+ excel files, each around 5-15MB. The output will be written to a single excel file.

Sometimes i get the error "'OfficeOpenXml.Packaging.Ionic.Zip.BadReadException' in EPPlus.dll" when reading in/opening one of the excel files.

Sometimes i get the error when the code opens the output excel file.
E.g. using (ExcelPackage package = new ExcelPackage(masterFile))

Has anyone encountered this error:
"'OfficeOpenXml.Packaging.Ionic.Zip.BadReadException' in EPPlus.dll"

and is there a quick fix?

Thank you.

Edit: I currently get around this problem by creating a new excel file, and copying the contents of the excel data (from the excel file that causes the error) into the newly created file. I then delete the excel file that has the error and rename the newly created excel file to follow that of the original excel file.
But this approach is not ideal and i was hoping someone has a better solution.

comments

RoyBJY wrote May 1 at 4:23 PM

Just to