Excel Cannot Save or Export XML Data? Fix the Error

Errors & fixes · Updated November 19, 2026

If Excel says it cannot save or export XML data, first check whether you are saving the workbook or exporting mapped data: they are different operations. In Excel for Microsoft 365 on Windows, keep the workbook as an .xlsx file, then use Developer > Export to create XML; if that export fails, inspect the workbook’s XML map and the structure of the data before changing the file.

Saving a Workbook Is Not the Same as Exporting XML

An .xlsx workbook can contain worksheets, formulas, formatting, and an XML map. Saving that workbook with File > Save or Ctrl+S does not automatically create an XML data file. Exporting XML is a separate operation that writes data from cells connected to an XML map into a file that follows the map’s schema.

This distinction matters because the error can refer to two different tasks. If you see it while using Developer > Export, Excel is having trouble producing XML from the mapped data. If you see a warning while using Save As, you may be choosing a file format that does not preserve all workbook features. For routine editing, save a working copy as Excel Workbook (*.xlsx). Export a separate XML file only when another system needs the data.

There is also an older format called XML Spreadsheet 2003 (*.xml). It represents a spreadsheet in XML and is not the same thing as exporting XML data through an XML map. Choosing a different XML option in Save As may produce a file with different contents and limitations. Check the format and command you selected before troubleshooting the map.

What an XML Map Does in Excel

An XML map connects elements in an XML schema to cells or tables in a worksheet. The schema, often an XSD file, describes the expected names, relationships, and data types. For example, a simple order schema might define an Order element with an OrderNumber and a repeating LineItem element. Excel can map order fields to cells and repeating line items to a table, then use that map to import or export data.

The map is a connection between the worksheet and the schema, not a general-purpose converter for any XML document. Excel exports the data assigned to mapped cells and tables. It does not automatically include every worksheet cell, preserve the sheet’s visual layout, or convert formulas and formatting into equivalent XML features. Unmapped notes or calculations may not appear in the exported data.

This is why a workbook can save normally but still fail to export XML. Saving stores the workbook; exporting asks Excel to arrange mapped data according to a particular structure. A workbook may contain a map that Excel can keep but cannot use to generate the requested XML in its current form.

Check the Export Method and Required Features

XML map tools are available in the Windows desktop version of Excel. If the Developer tab is hidden, turn it on through File > Options > Customize Ribbon, select the Developer check box under Main Tabs, and choose OK. Then use Developer > Source to view the XML Source pane and Developer > Export to export mapped data. The exact controls available can depend on the workbook and its map.

Excel for the web does not provide the full desktop XML mapping workflow. XML map support is also limited on other platforms; if the Source or Export controls are missing, open the workbook in Excel for Microsoft 365 on Windows rather than assuming the map is broken. Do not rename an .xlsx file to .xml: changing the extension does not convert its contents.

Before trying repairs, make a copy of the workbook with File > Save As. Keep that copy as .xlsx so the map remains available while you investigate. If the XML file is an important deliverable, export to a new filename in a folder where you have permission to create files, rather than overwriting the only copy.

Diagnose the Map and the Schema

In Developer > Source, check whether the expected map appears and whether its elements are still connected to the intended cells or tables. If the map is absent, the workbook may not contain the mapping needed for XML export. If a schema was changed after the map was created, the map may no longer match the data structure expected by the receiving system.

Consider how the schema represents repeated information. A collection such as many line items is different from a single field, and nested repeating groups can be difficult to represent in a worksheet’s flat rows and columns. Excel’s XML mapping feature has structural limitations; not every valid XML schema can be represented or exported through worksheet mappings. A map with a complex hierarchy, unsupported schema features, or relationships that do not fit Excel’s mapping model can therefore be the cause even when the schema itself is valid XML.

Review the workbook’s mapped data as well. Check that values are in the mapped cells, that repeating records have been entered in the appropriate table, and that the sheet has not been rearranged in a way that disconnected the intended data from the map. If the destination system requires particular fields or formats, compare those requirements with the schema and the mapped values. A syntactically valid XML file can still be rejected by another application if its values or structure do not meet that application’s rules.

Fix Common Export Problems Step by Step

  1. Save a backup. Use File > Save As to create a separate .xlsx copy before changing maps or worksheets.
  2. Confirm the command. Use Developer > Export for XML data mapped to the workbook. Use Save As only when you specifically want a spreadsheet file format.
  3. Check the map. Open Developer > Source and confirm that the expected XML map and mapped elements are present. If they are missing, locate the original schema or ask the workbook’s author for the correct mapped template.
  4. Review repeating data. Confirm that repeating records are organized in the mapped XML table, not scattered across unrelated cells or placed in a layout that conflicts with the schema.
  5. Test the output location. Export to a new file in a local folder you can write to. This helps distinguish a path, access, or overwrite problem from a mapping problem.
  6. Compare with the schema. If the map was built from an XSD, check whether the schema has changed and whether its nested or repeated elements can be represented by Excel’s XML mapping tools.
  7. Rebuild only when necessary. If the map is damaged or incompatible, create a new workbook from the correct schema or obtain a fresh mapped template. Removing a map can break the existing links, so do not delete it in the only copy.

If Excel gives a more specific message, use that wording to narrow the cause. A map-related message points toward schema or mapping compatibility; a message about a file location or access points toward the destination path or permissions. Fixing the wrong category can waste time and may put the workbook’s mappings at risk.

Why XML Export Can Differ from What You See

An exported XML file contains mapped data, not a picture of the worksheet. For example, a worksheet might show a total calculated with a formula, shaded header cells, and a note beside a table. The XML export may include only the values assigned to mapped fields; it does not necessarily include the formula, shading, or note. If a receiving application expects a total field, verify that the schema includes it and that Excel has a mapped value to export.

Data types and blank values also matter. A cell that looks like a date or number may be stored differently from what the destination expects, and an empty cell may be interpreted differently from an omitted element. The schema and the destination application determine what values are acceptable. If a system rejects a file that Excel successfully exported, check the returned validation message and compare the actual XML structure and values with the system’s specification.

For a small sample, export a copy and inspect the resulting .xml file in a text editor. Compare element names, nesting, and a few representative values with the expected format. Avoid editing the only export manually if the file must be regenerated from Excel later; correct the workbook’s mapped data or schema process instead.

Alternatives When Excel Cannot Export the Schema

If the schema is beyond Excel’s XML mapping capabilities, repeatedly rebuilding the same map may not solve the problem. Ask the receiving system’s owner whether it accepts a simpler XML structure, a CSV file, or another supported exchange format. CSV can transfer tabular values but cannot represent nested XML relationships, so it is suitable only when the receiver can use a flat table.

For a complex or recurring exchange, a dedicated data transformation or integration tool may be more appropriate than worksheet mapping. The right option depends on the target system’s schema, how often the export runs, and whether data must be validated or transformed. Keep an unchanged source workbook and test any alternative using a non-production sample before relying on it for a business process.

Do not assume that changing the file extension, saving as an older Excel format, or copying the worksheet to a new workbook will make an incompatible XML map exportable. Those actions do not correct the relationship between the schema and the mapped data. Preserve the original workbook and use a route that explicitly supports the required XML structure.

Frequently Asked Questions

Why can I save the workbook but not export XML?
Saving stores the workbook and its contents. XML export separately tries to serialize mapped worksheet data according to an XML map, so the export can fail if the map or schema is not supported or the mapped data does not fit the expected structure.

Where is the XML Export command in Excel?
In Excel for Microsoft 365 on Windows, show the Developer tab through File > Options > Customize Ribbon if needed. Then choose Developer > Export. The command is for mapped XML data, not for converting every worksheet into XML.

Can I export XML from Excel for the web?
The web version does not provide the full desktop XML mapping workflow. Open the workbook in the Windows desktop app to use its XML Source and Export tools, if the workbook and map are supported.

Does exporting XML include formulas and formatting?
Not as worksheet formulas and visual formatting. XML export follows the map and includes mapped data. If the receiving system needs a calculated value, make sure the relevant value is represented in the map and supplied in the expected form.

Will saving as XML fix the export error?
Not necessarily. Save As XML and Developer > Export create different kinds of output. Choosing a spreadsheet XML format does not repair an incompatible XML map, and it may change which workbook features are retained.

When to Ask for a New Template

If the workbook’s map is missing, the original schema is unavailable, or the target system requires a nested structure Excel cannot export, request a current template from the workbook’s author or the receiving system’s support team. Include the exact Excel error, the export method, and whether the failure occurs with a new destination file. That information helps identify whether the issue is the map, the schema, the data, or simply the save location.

The safest general approach is to keep the workbook in .xlsx, export mapped XML through the Windows desktop tools, and treat the schema as the specification for what Excel can produce. Separating workbook saving from XML export makes it easier to diagnose the error without risking the original data.

Related

Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.

More in Errors & fixes

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.