Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How To Do Relative xPath In CustomXMLNode? johnywhy Excel Discussion (Misc queries) 0 January 3rd 11 01:35 AM
Excel invoke REST service function with Xpath fn parse result! Rand0m1y Excel Worksheet Functions 0 June 4th 09 03:43 PM
Programmatic Hiding [email protected] Excel Discussion (Misc queries) 2 September 29th 07 01:13 PM
Multi - Level Question involving Data Mapping and Formulation [email protected] Excel Worksheet Functions 0 September 6th 05 09:36 PM
Xpath For Xml Map WStoreyII[_2_] Excel Programming 0 August 6th 04 03:11 AM


All times are GMT +1. The time now is 01:32 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"