Program with XML Maps
The preceding sections explained how to use the new XML features found in Excel and provided code for saving, transforming, importing, and exporting XML with Excel. Those sections provide a context for Excel’s XML features and explain programming tasks that surround those features. The rest of this chapter deals exclusively with the XML objects Excel provides and offers specific examples of programming tasks you can perform with those object, properties, and methods.
Excel’s XML object model deals exclusively with XML maps. Opening and saving XML spreadsheets is done through the Workbook object’s Open and Save methods. Figure 15-18 illustrates the Excel XML objects hierarchically.

Figure 15-18. The XML object hierarchy
The XmlMap object allows you to perform the following tasks in code:
Add XML maps to a workbook
Delete XML maps from a workbook
Export XML data through an XML map
Import XML data through an XML map
Bind an XML map to an XML data source
Refresh mapped lists and ranges from an XML data source
View the XML schema used by an XML map
The following sections explain these tasks in greater detail.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access