I am trying to find a way to use VBA to update XML mapping when I need to add to a given schema/mapping. I am working with Excel 2007 (basically looking for an equivalent to the Excel 2003 XML Toolbox.) Basically, I want to be able to have a XML Schema with elements A & B as an XML source for my Workbook (I'll call it WB). WB will have Map1 with elements A & B mapped to random cells (ie can be anywhere...not necessarily in Row or Column form). If I need to capture a 3rd piece of data, C (manualy created in my existing schema), how can I replace Map1 with Map2, such that A & B would be mapped to their locations from Map1 (with C needing to be mapped).
I've come across this link:
http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/ed2ddffb-b3f8-47b3-a0b0-31bd55abfcf2
But cannot really figure out the code snippets. Looks like he is calling some functions that were not included in the answer post.
I've been spinning my wheels trying to figure out how to either:
A. Check any UsedRange for an XML Mapping, and finding the name of the Mapping (Root/Parent/Child) and switching that from Map1 to Map2 for that UsedRange
B. Check each element in my Mapping for Map1 (Root/Parent/Child) and returning the range associated with that element. I could then reassign that range with the element in Map2 that matches the same Root/Parent/Child path.
I think part of my hang up is not completely understanding what exactly XPath is, so if someone could explain what that is referring to that would probably be a big help.
I've come across this link:
http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/ed2ddffb-b3f8-47b3-a0b0-31bd55abfcf2
But cannot really figure out the code snippets. Looks like he is calling some functions that were not included in the answer post.
I've been spinning my wheels trying to figure out how to either:
A. Check any UsedRange for an XML Mapping, and finding the name of the Mapping (Root/Parent/Child) and switching that from Map1 to Map2 for that UsedRange
B. Check each element in my Mapping for Map1 (Root/Parent/Child) and returning the range associated with that element. I could then reassign that range with the element in Map2 that matches the same Root/Parent/Child path.
I think part of my hang up is not completely understanding what exactly XPath is, so if someone could explain what that is referring to that would probably be a big help.