6 min read
Open an XML file in Excel on Mac
By Quentin Delepierre, Salesforce Commerce Cloud consultant
On Mac, opening an XML file in Excel isn't obvious: the XML tools of the Developer tab are reserved for Excel for Windows, and Power Query can read an XML file without ever writing it back. Here is what Excel for Mac offers, the other options (text editor, Numbers, converters) and the method to edit the table and get back an XML file with its original structure.
Got your own XML? Drop it in and see it as a table, free and with no account. For an Excel file you can edit and then rebuild into an XML that keeps its structure, a free account is all you need.
Simple Excel table, free with no account, for files up to 1 MB. File that rebuilds into XML: free account, 3 free credits, no credit card.
What Excel can do with an XML file, on Windows and on Mac
On Windows, Excel offers two paths. With a Microsoft 365 subscription: Data › Get Data › From File › From XML. And the older XML maps path: Developer tab › Import, which also exports to XML, with its limits.
On Mac, according to Microsoft's help pages:
- XML maps and the XML Source pane of the Developer tab aren't available: Microsoft states that only Excel for Windows offers XML mapping, which isn't in Excel for Mac or Excel for the web. Microsoft also lists it as a legacy feature and recommends Power Query.
- Power Query reads XML: the list of sources of Excel for Mac includes XML, for Microsoft 365 subscribers (the query editor needs version 16.69 or later). On the Data tab, choose Get Data (Power Query), then XML.
- No export to your own structure: the only .xml format offered when saving is “Excel 2004 XML Spreadsheet (.xml)”, which writes the workbook in Excel's own XML schema, not in the structure of your file.
Power Query is enough to read, not to write back
To look at or analyze an XML file, Power Query does the job: it shows the content as tables, and nested XML arrives as “Table” or “Record” columns that you expand one by one. It does not write XML back, though: your fixes stay in the workbook.
To edit a file and import it elsewhere (Google Merchant Center, Business Manager, a PIM…), you need a round trip: the XML becomes a table, you edit it, and it becomes the same XML again.
The other options on Mac
- A text editor: it shows the XML as it is and is enough to fix a value or two. On hundreds of rows it is tedious, and one badly closed tag makes the file invalid.
- Numbers: Apple's help describes importing Excel files and text files (delimited or fixed-width), and doesn't mention XML.
- An online converter: many only go one way, to a CSV or an Excel file. Check that it can rebuild the original XML, and what happens to your file once uploaded: for a client file, that matters.
- A Windows machine, or a virtual machine, to use XML maps: possible, but Excel's export refuses nested lists (see the guide on the “list of lists” error).
The round-trip method with ExcelifyXML, on Mac
The .xlsx opens in Excel for Mac like an ordinary workbook. Every value is written as text: leading zeros, EAN codes and dates aren't converted.
- With Safari, Chrome or the browser of your choice, open the Upload page and drop the XML file. The free preview (“Free preview”) shows the detected row, the number of rows and columns and the first values. No credit is used until you confirm. Without an account, you can already see the preview and, for a file of 1 MB or less, download a simple Excel table for free (without the structure: it can't be rebuilt into XML).
- Confirm with “Transform to CSV — 1 credit”, then choose the Excel file (.xlsx).
- Open the .xlsx in Excel for Mac and edit the cells. Leave row 1 alone: its names say where each value goes back in the XML. Save as .xlsx.
- Drop the saved .xlsx, alone, on the Rebuild page, which is free: you get the XML back with its original structure.
Excel for Mac specifics
- Line break inside a cell: Ctrl+Option+Enter (Cmd+Option+Enter in recent versions). To enter a cell, double-click or Ctrl+U. Handy for lists of values, one value per line.
- Save as .xlsx. If you prefer a CSV, choose “CSV UTF-8”: with the plain “CSV” of an Excel for Mac, a lone accented value can be misread when rebuilding.
- Numbers removes the .xlsx's hidden sheet that keeps the structure: if you saved with Numbers, drop the skeleton.json too (“Separate files”).
Variant: the standalone Excel workbook on Mac
The standalone Excel workbook (2 credits) works in desktop Excel for Mac. At every opening, Excel asks “Do you want to disable macros before opening the file?”: choose “Enable Macros” for that workbook, without changing Excel's security settings.
When you click “Generate XML”, the save window offers “Excel Workbook (.xlsx)” by default: choose “Excel 2004 XML Spreadsheet (.xml)” under “File Format” (the macro writes the content itself). If macros stay blocked, save the workbook and drop it on the Rebuild page: the site reads its data without running the macro.
Common mistakes
- The XML entry is missing in Power Query: Microsoft's page on Power Query for Mac applies to Excel for Microsoft 365. Check your subscription and update Excel.
- The Power Query table is unreadable: nested XML arrives as columns to expand. For an already flattened table, one column per field, drop the file on ExcelifyXML instead.
- The rebuilt XML doesn't have your edits: you dropped the original file, or the .excelify.zip as downloaded. Drop the .xlsx you saved.
Drop your XML file to open it as a table: the preview is free and needs no account, nothing is charged without your confirmation:
Transform a file