Export Excel to XML and vice versa

You can convert Excel file to XML data file or vice versa. This allows information to be exchanged between different applications. To get started, open the tab Developer (Developer).

Here is the data we want to convert into an XML file:

First, let’s create a schema based on the original XML data. The schema defines the structure of the XML file.

  1. Excel is not suitable for this purpose, so open, for example, Notepad and paste the following lines:

       

          Smith

          16753

          UK

          Qtr 3

       

       

          Johnson

          14808

          USA

          Qtr 4

       

Note: The tags are named after the column names, but you can give them any name you like. For example, instead of .

  1. Save the file as schema.xml.
  2. Open an Excel workbook.
  3. Click on Source (source) tab Developer (Developer). The XML taskbar will open.
  4. To add an XML map, click the button XML Maps (XML maps).A dialog box will appear XML Maps (XML Maps).
  5. Press Add (Add).
  6. Выберите schema.xml and double click OK.
  7. Now just drag and drop 4 items from the tree in the taskbar XML onto the sheet (row 1).
  8. Нажмите кнопку Export (Export) in the section XML tab Developer (Developer).
  9. Save the file and click Enter.

Result:

This saves a lot of time!

Note: To import an XML file, open a blank workbook. On the tab Developer (Developer) click Import (Import) and select the XML file.

Leave a Reply