Chapter 7. Using SpreadsheetML

While many users will find Excel’s easy import of XML documents useful, developers who need to read or create Excel spreadsheets may find a completely different set of capabilities more relevant. The functionality provided in Spreadsheet ML, which was also available in Microsoft Excel XP, allows developers to save spreadsheets as XML documents and to open those XML spreadsheets in Excel. If you need to create or process spreadsheets using XML, then this chapter will give you the foundations you need.

Tip

Microsoft offers the Office 2003 XML Reference Schemas from http://microsoft.com/downloads/. If you want a complete definition of every component in SpreadsheetML, the schema and its documentation are much more detailed than this chapter can be.

Saving and Opening XML Spreadsheets

Excel treats XML spreadsheet files pretty much like regular .xls binary files. Microsoft has captured nearly all of the information stored in Excel workbooks in its XML format, with some major exceptions, including embedded Visual Basic for Applications (VBA), charting information, OLE objects, and drawing objects. It works very well for basic data import and export, but not as well for more sophisticated spreadsheets. While you can, for example, use VBA and charting on information stored in the XML maps described in Chapter 6, that functionality will be lost if you save the spreadsheet itself in SpreadsheetML and don’t keep a .xls copy.

Tip

If you need access to Excel ...

Get Office 2003 XML now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.