Free Support Forum -

Opening my SpreadSheetML file crashes

I am currently evaluating Aspose.Excel to convert Excel2003 to Excel97 files

Unfortunately it wont open my file.

I tried
excelObject.Open(sPath, FileFormatType.SpreadsheetML);

It says "invalid file format" or crashes in the XML parser.

The file opens fine in Excel2003 and is quite simple.
Is there something I can do?
The file is attached.

Is this xml file created with Excel2003? I don’t think so because it doesn’t strictly obey the rules of SpreadsheetML.

I found 2 problems in your sample file:

1. In the xml, encoding is UTF-16. But it’s actually UTF-8.
2. In one cell, the data is:

But in Excel generated xml file, it will be omitted or will be:


I removed the encoding information in your file to solve the first problem and changed my code to solve the second problem.

Please try the attached file. It includes a new fix and the changed xml file.

Thanks. I fixed my code to not generate empty cells and to avoid the UTF16.
It works now even without the patch you sent. Excellent!