Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

Tue Jan 04, 2022 8:34 pm

Trying to evaluate this product to see if it meets my needs, but I'm having issues.

I keep getting that my file is: "This file's format is not supported or you don't specify a correct format."

The file is coming in from a Vendor that I'm trying to do some automation against, so I can't control the source. The file extension is XLS, but even my Excel says something is funky with it (Excel opens with warning). After messing around for a while, it turns out it is an Office 12 XML Spreadsheet, apparently misnamed to XLS. If I rename to .XML and open in Excel it opens clean.

Code: Select all
<?xml version="1.0"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook
xmlns="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-    microsoft-com:office:excel"
xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet">
xmlns:html="http://www.w3.org/TR/REC-html40">
<DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
<Version>12.00</Version>
</DocumentProperties>


So, I've gone back and forth numerous scenarios, both file extensions, various configs in Spire like setting Workbook.Version set to 2007, with no luck. I also tried load from XML, and various other combinations and always get that the format is wrong. When I try to load from XML, it says data at root element 1 is wrong, so i'm guessing it's expecting different XML than what I'm trying to do.

Is this supported somehow in the product?

Also, excuse me, I'm not the best dev. I'm a PM that can write a little code here and there.

jakirkpa
 
Posts: 2
Joined: Tue Jan 04, 2022 8:24 pm

Tue Jan 04, 2022 10:00 pm

After more research, its SpreadsheetML apparently and I need to get it converted to OOXML.

jakirkpa
 
Posts: 2
Joined: Tue Jan 04, 2022 8:24 pm

Wed Jan 05, 2022 3:54 am

Hello,

Thank you for your inquiry.
Sorry, currently our Spire.XLS only supports converting Office OpenXML to Excel. So before you use our Spire.XLS to convert it to an Excel file, please convert your XML file to the Office Open XML file.
Code: Select all
Workbook workbook = new Workbook();
workbook.LoadFromXml("output.xml");
workbook.SaveToFile("result1.xlsx", ExcelVersion.Version2007);

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1650
Joined: Wed Apr 07, 2021 2:50 am

Return to Spire.XLS