excel: Cannot save or export xml data. The xml map in this workbook are not exportable excel: Cannot save or export xml data. The xml map in this workbook are not exportable xml xml

excel: Cannot save or export xml data. The xml map in this workbook are not exportable


The usual reason is the Excel doesn't understand very complicated XML.

From office.microsoft.com:

An XML mapping cannot be exported if the mapped element’s relationship with other elements cannot be preserved. This relationship may not be preserved for the following reasons:

The schema definition of a mapped element is contained within a sequence with the following attributes:

  • The maxoccurs attribute is not equal to 1.
  • The sequence has more than one direct child element defined, or has another compositor as a direct child.
  • Nonrepeating sibling elements with the same repeating parent element are mapped to different XML tables.
  • Multiple repeating elements are mapped to the same XML table, and the repetition is not defined by an ancestor element.
  • Child elements from different parents are mapped to the same XML table.

Additionally, the XML mapping cannot be exported if it contains one of the following XML schema constructs:

List of lists

  • One list of items contains a second list of items.

Denormalized data

  • An XML table contains an element that has been defined in the schema to occur once (the maxoccurs attribute is set to 1). When you add such an element to an XML table, Excel fills the table column with multiple instances of the element.

Choice

  • A mapped element is part of a schema construct.


I had a similar issue. It was a simple sheet and contained just 8 columns but the XML export kept throwing this error. I found that if the order in which the elements appeared in the XML schema did not match the order in which the columns appeared in the sheet, I got this error. I rearranged the columns in my sheet to be the same as the order of elements in the schema & the export became successful.


On a lot of webpages there are instructions for how to export to xml (example: https://www.excel-easy.com/examples/xml.html). When I was creating a schema for a pre-existing data I ran across the following.

  1. forgot to have a single outer wrapper tag for the rows (main reason for the error that brought me to this page)
  2. didn't get the data types right (what looked like numeric was actually text - more of a nuisance I think, but I fixed it first).

Your XML that gets converted to a schema should look like this (I don't know if it needs two "sample rows" but it helps with remembering the outer tag):

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><singleOuterWrapperTag>    <rowTag>        <columnA>Data Type (numeric, text)</columnA>        <columnB>Data Type</columnB>    </rowTag>    <rowTag>        <columnA>Data Type (numeric, text)</columnA>        <columnB>Data Type</columnB>    </rowTag></singleOuterWrapperTag>