C# Excel Add-in / XML / XPath Problem

  • Thread starter Thread starter Peter Smith
  • Start date Start date
P

Peter Smith

Hello,
I've a problem, and I'd appreciate any help you can offer.
I'm developing an Excel XP Add-In with C#.

The scenario is the following:

1. connect to a web service to get XML data (this works already)

2. how do I fill the cells with the XML data (there are Xpath
directives in the cells)
(and that is my problem


example
XML Data:

<data>
<value>1234</value>
</data>

excel cell formula "<abc:/data/value>"
(note I us e <abc:...> to distinguish between normal text and a
formula.


Thanks a lot
-Peter
 
Peter,

If you need to populate the cells, then what I would do is get all the
cells that need populating. Once you have that, you can get the XML content
from the dataset and place it into an XMLDocument instance. Once you have
that, you can then easily select the node that corresponds to the cell
formula and populate the value with what is in the XML from the dataset.

Hope this helps.
 
Back
Top