Zombse

The Zombie Stack Exchanges That Just Won't Die

View the Project on GitHub anjackson/zombse

Excel-only toolkit for creating XML data?

I'd like to use Excel to programmatically create XML data files to several known XSD schemas; or more specifically, a small profile of each schema.

Are there any sets of macros/procedural ways of using functions & Excel add-ins you know of that can (help me to) do this?

Michael Hopwood

Comments

Answer by kardeiz

Excel provides some functionality for importing schema, mapping XML elements to spreadsheet columns, and exporting XML. See this MS Office page for more details and setup instructions.

You have a couple options for applying the XSD to your data inside Excel. If you are comfortable editing your XSD file, you could name your column headers inside and have them automatically merge when you import the XSD.

Alternatively, you could add your XSD as an "XML Map", drag it to a workbook, and reorganize your data as necessary.

If you want to do it the VBA way, check out the XMLMaps and SaveAsXMLData methods on ActiveWorkbook (e.g. http://msdn.microsoft.com/en-us/library/office/ff196723.aspx).

This topic is pretty well-covered on StackOverflow; see here for related questions.

Comments