Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Programmatic schema mapping, XPath.SetValue question
Hi! I need to programmatically map an element in my Excel 2003 xml schema to
my spreadsheet. For example, I have the following element in my schema: <xsd:element name="TemplateE66" type="xsd:double" minOccurs="0" nillable="true" form="qualified"/ I need to map it to Cell E66 in my worksheet (also named "Template"). I've been playing with XPath.SetValue method but can not figure out the correct way to call it in neither VB nor C#. Specifically, I can not get the XPath parameter to SetValue right. Any idea/sample/url is greatly appreciated. Thank you in advance, --Michael |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Programmatic schema mapping, XPath.SetValue question
I'm having similar problems, and different ones, but this has worked for me. First add the XML datamap .XSD set objMap = workbook.XmlMaps.Add(AbsolutePath & "\BOBBY.xsd","PowerShift") then map the cells individually. strXPath = "/PowerShift/C1A/Customer_number" Set xp = worksheet.Range("A1:A2").Offset(1,actColumn).XPath xp.SetValue workbook.XmlMaps(1), strXPath The problem with with approach is that it separates the column in such a way that if you change the data you can not export it back to an XML file. Your get an error when selecting "Verify map for export". Error stating. "A mapped element's relationship with other elements cannot be preserved. How do I fix this problem? -- roblo ------------------------------------------------------------------------ roblo's Profile: http://www.excelforum.com/member.php...o&userid=22469 View this thread: http://www.excelforum.com/showthread...hreadid=378595 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Programmatic schema mapping, XPath.SetValue question
Also, try this link: http://msdn.microsoft.com/library/de...ML_Toolbox.asp Using the Excel 2003 Object Model to Add XML Data Integration -- roblo ------------------------------------------------------------------------ roblo's Profile: http://www.excelforum.com/member.php...o&userid=22469 View this thread: http://www.excelforum.com/showthread...hreadid=378595 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How To Do Relative xPath In CustomXMLNode? | Excel Discussion (Misc queries) | |||
Excel invoke REST service function with Xpath fn parse result! | Excel Worksheet Functions | |||
Programmatic Hiding | Excel Discussion (Misc queries) | |||
Multi - Level Question involving Data Mapping and Formulation | Excel Worksheet Functions | |||
Xpath For Xml Map | Excel Programming |