Using XML to Round Trip a Workbook from Excel to HTML and Back

Microsoft is thrilled that you can now save Excel 2003 and Word 2003 documents as XML files. They consider XML files to be native Office documents now. This is cool, because it means that any program that can write XML can, in theory, produce an Excel file on the fly.

Round-tripping is the process of saving an Excel file as XML, and then opening the XML file back into Excel. Figure 15.5 shows the results of round-tripping an Excel file. The file on the left contains greenbar formatting, strange fonts, and a chart. The formatted spreadsheet on the left was saved as an XML Spreadsheet file, closed, and re-opened as the file on the right. Excel did warn that the chart and any VBA code would be lost. Other than the chart, all other formatting was preserved perfectly on the round-trip to XML and back.

Figure 15.5

Excel 2003 now supports XML as a native file format.

Figure 15.5

Excel 2003 now supports XML as a native file format.

Diagnosis Worksheet Template

Figure 15.6 shows a subset of the XML code created when an Excel file is saved as an XML spreadsheet file.

0 0

Responses

Post a comment