Excel - map lost when copying worksheet containing XML Maps to a separate file

Posted on 2013-12-11
Last Modified: 2013-12-13
I have an Excel file with a set of XML Maps defined on a worksheet in Excel 2007.
I would like to copy this worksheet out into different workbooks and have the XML Map be retained.  Currently the copied worksheet is completely blank for XML maps after the move; and I've tried using the Exporting as XML feature on the developer tab and seems to just export the worksheet data itself in an XML format vs exporting the XML Maps.

Is there any way to do this without manually remapping in the new workbook?
Question by:shellysuelll
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
LVL 15

Expert Comment

ID: 39712362
Have you reviewed the code located at


Author Comment

ID: 39712690
I had actually taken a brief look at that exact code earlier today and it seemed to be rebuilding the XML cell by cell so I hadn't attempted it yet as i was hoping for a way to move/copy all for the sheet at once.  I will definitely give it a try tonight and let you know.

Author Comment

ID: 39712949
Question related to the code in the provided link - what does the comment line refer to:
 'XML map file must be added to Workbook_To before running this code "

When i read the code i can see that it then executes maps by referencing XmlMaps.Item(#) in the non-mapped workbook; so I guess i'm confused as to how to get those xml.Maps Items in there in the first place
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 15

Expert Comment

ID: 39712983
Another thing to look at, if for no other reason then as a reference, is

where David talks about "refreshing" an XML schema within an XLSX file.

There is also a reference to the Add operation on page 105 of this book which may be of use

And also

which discusses creation of the map file in excel using VBA.

If you need the XML map repeatedly, have you considered using a template workbook?

In regard to your secondary question, the XML map file must be added to the file by referencing the map file as described in the last link in this post.
LVL 15

Accepted Solution

WalkaboutTigger earned 500 total points
ID: 39712984
By the way, my method of answering these questions is generally more about educating the person asking the question rather than just giving an answer which may or may not precisely fit the individual's needs as these questions frequently get referenced by others having a similar, though not identical, issue.

Author Comment

ID: 39713153
Thanks for the additional info; definitely wasn't looking for precise fit answers - just trying to understand the options on this area of functionality.  I will take a read thru your provided links and then award points accordingly.  Thanks again.

Author Closing Comment

ID: 39717940
Not quite a specific answer to my question, but thanks for providing the more detailed information to reference for information. Appreciated!

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question