Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

Simple question. Does anyone know an easy way to convert SpreadsheetML (Excel 2003 XML) to the Open Document XML used for Excel 2007 (xlsx) files?

I've got a library that unfortunately doesn't read the XML format, so I need to try and find a way to read the data, that doesn't involve another library.

Any suggestions appreciated.

share|improve this question
    
Bit more info. The reason I'm not/can't use the Interop because this could be a server process for which the Interop doesn't work. The library I'm currently using is a workaround but only supports XLS and XLSX files. I recently have had a new requirement which needs to work with another function, that produces the XML suitable for Excel 2003. However this isn't/won't be supported by the library, so I'm trying to find a way around this. –  Ian Aug 25 '09 at 16:19

5 Answers 5

up vote 1 down vote accepted

The file format has indeed changed significantly from SpreadsheetML to Office Open XML.

And, since now spreadsheet files are broken into multiple XML files (which are all then zipped), there's no real hope of an easy XLST solution.

The most straightforward course of action, unfortunately, is to automate Excel using a macro to open each SpreadsheetML files and do a "Save As" to the newer format. This can be done in Office 2003 with the Office 2007 file format plug-in. Perhaps this can be relegated to a batch process so the server is not directly involved?

If the data in the spreadsheets are trivial and follow a consistent format, you can write your own parser to import directly from the SpreadsheetML files.

share|improve this answer
    
Think we might have to do them manually, and just place certain restrictions on the user depending on if its automated or not. Thanks –  Ian Sep 1 '09 at 11:00

An easy way would be to use Excel's COM Library (Excel 2007), but I think that's not the answer you are looking for.

What's your library capable of? You could use the Open XML SDK 2.0 to write the spreadsheet document based on the output of your library.

Best Regards

share|improve this answer
    
Just checked that out but unfortunately not, as we currently have to build against .NET 2.0 –  Ian Aug 25 '09 at 16:21

If you've got deep pockets Aspose.Cells can read/write both formats and should provide for really easy conversion without automation.

http://www.aspose.com/categories/.net-components/aspose.cells-for-.net/default.aspx

Aspose.Cells for .NET

Aspose.Cells for .NET is an award-winning Spreadsheet component that allows .NET developers to embed the ability to read, write and manipulate Excel spreadsheets into their own applications without needing to rely on Microsoft Excel.

Aspose.Cells for .NET is a mature, scalable and feature rich component that offers many functions that are way beyond the simple data exporting capabilities of other vendors. With Aspose.Cells for .NET developers can export data, format spreadsheets to the most granular level, import images, import charts, create charts, apply and calculate complex formulas, stream Excel data, save in various formats and much more - all this without the need to use Microsoft Excel or Microsoft Office Automation.

Pricing starts at $899 per developer for enterprise (internal) development and goes up from there very steeply.

share|improve this answer
    
+1 because indeed Aspose would do the job, and actually would have circumvented the issue in the first place. In the end though I wrote my own parser to re-construct the spreadsheet using the API we had already purchased. –  Ian Jan 25 '11 at 9:00

Try using JODConverter. JODConverter allows conversion of SpreadsheetML using the OpenOffice.org or Libreoffice engine.

share|improve this answer
    
Looks like an abandoned project? –  BrainSlugs83 Jun 13 '13 at 4:17

IIRC the Office 2003 format works like OpenDocument format: It's a ZIP file with XML files inside, so (if you have enough time/courage) you can open it, find the XML file that contains the data and finally deal with XML.

I know, this answer is for brave developers ;)

Regards.

share|improve this answer
2  
However the XML within the XLSX zip file appears to differ quite significantly from the XML within the Excel 2003 XML format. –  Ian Aug 25 '09 at 16:20
    
I'm afraid that's a "feature" from M$ guys, but you are there to fill the gap ;) –  ATorras Aug 25 '09 at 16:32
    
Yes, WordprocessingML != OpenXML. –  BrainSlugs83 Jun 13 '13 at 4:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.