On Sat, 11 Oct 2008 15:57:09 -0700, K Viltersten <tm**@viltersten.com>
wrote:
As far i can see i can't save an Excel document as
XML (OOXML, if you like).
Any time you save an Excel document using the native Excel format, that's
exactly what you're doing.
Am i missing something? I
took that you ment that i should create a document, save it as OOXML and
then end up having a template
on how to design a formatted document. Did i got it
right? If so, how do i get the OOXML-ized Excel file?
Your questions are really much more appropriate for a newsgroup
specifically about the use of Office and/or Excel.
Briefly: the Office 2007 file format is basically a ZIP file with some XML
files contained within. For your own program to create a document in this
format that Excel can read, you need to comply exactly with the
appropriate file format, including creating the XML exactly to the Excel
specification and storing it inside a ZIP-format file with the appropriate
extension (.xlsx for Excel 2007).
As far as the exact file format goes, you need to consult Microsoft's own
documentation for the file format, assuming it exists (I believe that
they've made this format public, but I recall for certain that's true,
never mind do I know off-hand where the documentation might be).
To create one of these files from within Excel for your own reference,
just save your Excel document. The .xlsx file that's written is what
Jeroen is talking about.
Note that this is very different from writing some arbitrary XML file.
Excel does in fact read XML files, and will even provide a default schema
that interprets the XML as a kind of simple textual database file. But
this kind of XML input for Excel will not include any special formatting
or document-specific features that Excel has. It's completely different
from the Excel-specific ".xlsx" XML-based file format.
Pete