This project is read-only.

Excel found unreadable content in filename.xls

Jan 20, 2014 at 2:55 PM
I'm trying to run some examples and when I open excel files, occurs an error: "Excel found unreadable content in filename.xls"

I compiled the example: "CreateEmptyWorkbook"

Jan 23, 2014 at 4:08 PM
I'm experiencing the same issue, with example "ScatterChart" excel 2010.

Here is link on result file.

Is there any workaround?
Jan 23, 2014 at 4:57 PM
Yes, thekg, there is a workaround.

The worksheet XML that is being written has the wrong decimal separator ("," instead of "."). (Unzip the xlsx and find the xl\worksheets\worksheet1.xml file, find the pagemargin info)

Seems like your Windows on a locale other than EN. As is mentioned in the post here, setting your culture info to EN... before writing the xml streams will make sure that all decimal numbers are being written in the correct format, i.e. with a "." as a decimal separator.

Is there another way to make sure the XML is being written correctly on any international system? Not many countries use "." as a decimal separator.
Jan 24, 2014 at 4:52 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
May 23, 2014 at 3:29 PM

I thing I've found the origin of the issue, I've spend one day comparing why an application was giving an error and another now

I was even testing with a close to empty workshhhet having just one row with one column and a little "Test" as content

The issue was coming from the culture !!!!!

The workaround is to fix the culture to US BEFORE the use of NPOI :-(
  CultureInfo ci = new CultureInfo("en-US");
  Thread.CurrentThread.CurrentCulture = ci;
  Thread.CurrentThread.CurrentUICulture = ci;
Jul 4, 2014 at 5:27 AM
This bug is fixed in NPOI 2.1.1. Please help test again.