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

Get "Unreadable content" when saving any file

Feb 4, 2013 at 8:56 PM
EPPlus is a great project and all, but I'm a bit confused here. Creating files goes flawlessly but when it comes to opening and saving I get an "Unreadable content" error and suggestion to repair it by Excel. It's actually working, but seeing this error each time is annoying.
Not much to describe here... just doing this:
FileInfo f = new FileInfo("test.xlsx"); // Newly created file in Excel.
ExcelPackage p = new ExcelPackage(f);
p.Save();
And that's it. I'm using Russian localization for Windows and Excel, can it be the issue? Also when Excel repairs the file it says this (rough translation from Russian):
Deleted records: Style from part /xl/styles.xml (Styles)
Recovered records: Information about cells from part /xl/worksheets/sheet1.xml
P.S.: Also, editing an EPPlus-created file goes without errors.
Editor
Feb 4, 2013 at 9:07 PM
Edited Feb 4, 2013 at 9:09 PM
Several issues leads to unreadable content, please take a look at this threads

http://epplus.codeplex.com/discussions/223843
http://epplus.codeplex.com/discussions/265191
Feb 4, 2013 at 9:12 PM
Edited Feb 4, 2013 at 9:14 PM
Yes, I googled it. It has nothing to do with my case, because I just trying to open and save an empty file without editing. So it can't be bad formula or something. I'm also not working with web stuff.
Editor
Feb 4, 2013 at 9:40 PM
So lets try something else...

1) Create a file with epplus, after open and repair the file with excel, "Save As" this copy.
2) Rename both file to zip and extract them
3) Do a diff folder merge with winmerge, tell us where is the difference.

Maybe we can figure out your problem.
Feb 4, 2013 at 10:33 PM
Okey... I compared the EPPlus resaved file and the same file repaired by Excel. So the problem is with the styles.xml file with a complete empty file and also the sheet1.xml with file including some data.

So, the diffs.
Styles.xml from new Excel file:
<fonts x14ac:knownFonts="1" count="1">
After EPPlus:
<numFmts count="0"/>
<fonts count="1">
And from repaired it is again:
<fonts x14ac:knownFonts="1" count="1">
Sheet1.xml file with some data:
<sheetData>
   <row r="1">
      <c r="A1" s="2">
         <v>123</v>
      </c>
      <c r="B1" s="2" t="s">
          <v>0</v>
      </c>
      <c r="C1" s="2">
         <f>A1*2</f>
      </c>
   </row>
</sheetData>
And from repaired file:
<sheetData>
   <row r="1" x14ac:dyDescent="0.25" spans="1:3">
      <c r="A1">
         <v>123</v>
      </c>
      <c r="B1" t="s">
         <v>0</v>
      </c>
      <c r="C1">
         <f>A1*2</f>
         <v>246</v>
      </c>
   </row>
</sheetData>
Here's the bunch of files: https://dl.dropbox.com/u/11472736/ExcleEpplus.zip