Sunteți pe pagina 1din 9

Excel to XML - Easy Excel Tutorial http://www.excel-easy.com/examples/xml.

html

Excel Easy
#1 Excel tutorial on the net Excel Introduction Basics Functions Data Analysis VBA 300 Examples Ask us

XML
You can convert your Excel file to an XML data file, or vice versa. This enables you to exchange data between
Chapter
different applications. First, turn on the Developer tab.

Here's the data we want to convert to an XML data file. Share

Learn more, it's easy

Embed

PDF

Share Workbooks

SkyDrive

Web App

Import Access Data

Microsoft Query

Import/Export Text Files

XML

Download Excel File

1 of 9 08-11 05:50 PM
Excel to XML - Easy Excel Tutorial http://www.excel-easy.com/examples/xml.html

data-set.xls

Start Download
Open Documents Start Download XML Files
Here! schema.xml

data-set.xml

Follow Excel Easy

First, we will create a schema based on XML source data. The schema defines the structure of the XML file. We
have to do this outside Excel.

1. For example, open Notepad and add the following lines.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>


<data-set xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<record>
<LastName>Smith</LastName>
<Sales>16753</Sales>
<Country>UK</Country>
<Quarter>Qtr 3</Quarter>
</record>
<record>
<LastName>Johnson</LastName>
<Sales>14808</Sales>
<Country>USA</Country>
<Quarter>Qtr 4</Quarter>
</record>
</data-set>

Note: the tags refer to the column names, but you can give them any name you want! For example, instead of
LastName use Name.

2. Save the file as schema.xml.

2 of 9 08-11 05:50 PM
Excel to XML - Easy Excel Tutorial http://www.excel-easy.com/examples/xml.html

3. Open data-set.xls.

4. On the Developer tab, open the XML Source task pane.

5. To add an XML map, click XML Maps...

3 of 9 08-11 05:50 PM
Excel to XML - Easy Excel Tutorial http://www.excel-easy.com/examples/xml.html

The XML Maps dialog box appears.

4 of 9 08-11 05:50 PM
Excel to XML - Easy Excel Tutorial http://www.excel-easy.com/examples/xml.html

6. Click Add...

7. Select schema.xml and click OK twice.

8. Now simply drag (map) the 4 elements from the tree onto the worksheet (row 1).

5 of 9 08-11 05:50 PM
Excel to XML - Easy Excel Tutorial http://www.excel-easy.com/examples/xml.html

9. On the Developer tab, under the XML group, click Export.

6 of 9 08-11 05:50 PM
Excel to XML - Easy Excel Tutorial http://www.excel-easy.com/examples/xml.html

10. Save your file as data-set.xml and press Enter.

Result:

7 of 9 08-11 05:50 PM
Excel to XML - Easy Excel Tutorial http://www.excel-easy.com/examples/xml.html

8 of 9 08-11 05:50 PM
Excel to XML - Easy Excel Tutorial http://www.excel-easy.com/examples/xml.html

That saves quite a lot of time!

Note: to import an XML file, open a blank workbook, on the Developer tab click Import, and select the XML file.

Max Life Term Plan


Tax Benefit + 1 Cr Life Cover@5840* p.a. &
Accident Cover. Buy Now!

Do you like this free website? Please follow us on Google+

Learn more about sharing, use the side menu >>


Go to Top: XML | Go to Next Chapter: Protect

COPYRIGHT (C) 2010-2015 WWW.EXCEL-EASY.COM. ALL RIGHTS RESERVED.


EXCEL 2010 TUTORIAL | HOW TO EXCEL | MICROSOFT EXCEL 2010 | EXCEL MACRO

9 of 9 08-11 05:50 PM

S-ar putea să vă placă și