Excel For Mac Import Xml

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

In the Import dialog box, click the option for the type of file that you want to import, and then click Import. In the Choose a File dialog box, locate and click the CSV, HTML, or text file that you want to use as an external data range, and then click Get Data.

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

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.

3. Open data-set.xlsx.

4. On the Developer tab, in the XML group, click Source to open the XML Source task pane.

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

The XML Maps dialog box appears.

6. Click Add.

7. Select schema.xml and click OK twice.

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

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

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

Result:

That saves quite a lot of time!

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

These days we all live and work in a multi-device, multi-platform world, and so when building Office 2016 for Mac, one of our key objectives was to make it as easy as possible to transition from using Office for Windows to using Office for Mac and back again. That’s why you’ll notice an interface that’s consistent with what you’d expect when using Office 2016 for Windows, and why we added support for virtually all of the Windows Excel Ctrl keyboard shortcuts. So when it came to working with external data, we applied that same logic: how can we make the experience great and working cross platform easier than ever?

External data in Excel 2016 for Mac

We examined how we could improve external data for Excel 2016 for Mac and made the following changes:

How to import multiple xml files into excel
  • Excel 2016 for Mac comes with a pre-installed and integrated SQL Server ODBC driver, which we worked hand-in-hand with Simba Technologies to provide.
  • Excel 2016 for Mac has a brand new Microsoft Query (MSQuery) and Connection Manager to make creating and managing all of your data connections easier and more consistent with Windows.

Let’s take a deep dive into how each of these improvements can help you.

Native support for ODBC data connections

Excel 2016 for Mac supports ODBC data connections with SQL Server and Azure SQL Database right out of the box. This means several great things for anyone who works with external data:

  • When creating or refreshing data connections to SQL Server, there are no third-party drivers required—everything you need is included right in the app.
  • Connections made to SQL Server in Excel 2016 for Mac will work in Excel for Windows and vice versa. Have a workbook with ODBC data connections you’ve been using on Windows and never been able to use on your Mac? Well, now you can with cross-platform compatibility.
  • If you want to connect to something other than SQL Server, we still have several great partners offering third-party drivers to connect to any data source you can imagine.

In addition, all of the ways in which you interact with external data are now consistent between the platforms. Looking for that Refresh button? It’s on the Data tab just as you’d expect.

The Data tab in Excel 2016 for Mac.

A better way to work with external data connections

One of the biggest improvements to working with external data connections in Excel for Windows in recent releases has been the Connection Manager. It provides a central place to see all of the data connections in a workbook, see where they are used, and modify, remove or refresh each one individually. With Excel 2016 for Mac, you now have that same Connection Manager you are familiar with from Windows. All of your connections are displayed, and you can click any of them to see where they are used in your workbook and to perform any action.

The all-new Connection Manager in Excel 2016 for Mac.

The Connection Properties dialog has been streamlined as well to match Excel for Windows, so that you now only see the properties that apply to your particular data connection.

All of your connection properties are in one place and just like Excel for Windows.

However, what good is easier management of your data connections if it’s too hard to create them to begin with? With Excel 2016 for Mac, creating a connection to SQL Server is easier than ever. On the Data tab, simply select New Database Query > SQL Server ODBC, and you are presented with a simple connection dialog. Once it’s filled out, the newly redesigned MSQuery launches.

The all-new MSQuery in Excel 2016 for Mac.

The new MSQuery experience is very similar to the SQL Query Analyzer that many of you have worked with. On the left is a listing of the databases and tables in your database that you can explore. At the top right is a color-coded SQL editor, and at the bottom right are the results of any query you run. Simply enter a SQL statement, click Run Query to make sure it works. Once it does, click Return Data to drop your data right back into your worksheet. And that’s it; your data is now in your Excel workbook, live and ready to use in Excel 2016 for Mac or Excel for Windows!

Working with a third-party data provider works the exact same way. The only difference is that after installing the data provider, you select New Database Query > From Database and then select your data provider from the Apple iODBC manager.

Now it’s your turn!

We think we’ve made huge strides in making external data easier than ever in Excel 2016 for Mac and we hope you do too. Give it a try and let us know of any questions or feedback you have in the comments!