Excel.Range.XPath.SetValue - pb

F

Franck

Hi,
Tryin to fill range with xml data like this.

'1. Add Schema
oExcel.ActiveWorkbook.XmlMaps.Add(tmpDs.GetXmlSchema, oRootElement)

'2. Map fields
oExcel.Range(oExcel.Caller.address,
Missing.Value).XPath.SetValue(oExcel.ActiveWorkbook.XmlMaps(1),
"/NewDataset/Table/NAME_SECUR", Missing.Value, Missing.Value)

'3. Import Xml Data
oExcel.ActiveWorkbook.XmlMaps(1).ImportXml(tmpDs.GetXml, Missing.Value)

The 1 & 3 line are correct but the 2 return me the following error :
"The XPath is not valid because either the XPath syntax is incorrect or
not supported by Excel."

I dont understand has it looks like msdn sample with
"/root/Table/FieldName" syntax.

does someone already played with Xpath ?
Any help would be very appreciated.

Thks in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top