Add an XML Map to an Excel Workbook

Automate Excel

Add an XML Map to an Excel Workbook

There are 2 sources for XML maps I know of:

1.You have a copy of the XML data you wish to map (XML file)
2.You know the location of the XML’s schema (XSD file)

In both cases, it’s simply a matter of pointing Excel to either location. In the first case Excel guesses at the Map, in the latter it uses the data in the Schema to create the map.

For this example lets assume we want to Create a Map for the XML data returned from the Yahoo Web Search Service.

This is a good example to demonstrate each method becuase they have a sample of the XML data available, and they also have the Schema available, and both work to create the Map.

Note: Keep in mind the XML or XSD files need not be at a url address, they can be saved on your local drive.

Create a Map in Excel
1. On the main menu goto Data->XML->XML Source
2. Click the XML Maps Button
xmlmap

3. In the newly opened dialog box click the Add button
addxmlmap

4. Enter the location of the XSD or XML file you wish to Map
xmlmaplocation

Note: If you are trying to paste the URL into the File Name box, you can’t right click in the box, you must use the paste shortcut (Ctrl-V)

5. Click the OPEN button.

That’s it, you should have an XML Map in your workbook based on the XML or XSD file you designated. Here’s what the map I just added looks like:
xmlmapfinal

One Response

  1. Last.Fm Data in Excel Says:

    [...] your username, that returns XML for your top artists. Getting that data into Excel is as easy as adding an XML Map and refreshing the [...]

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.