C# Excel Add-in / XML / XPath Problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Peter Smith

    C# Excel Add-in / XML / XPath Problem

    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
  • Nicholas Paldino [.NET/C# MVP]

    #2
    Re: C# Excel Add-in / XML / XPath Problem

    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.


    --
    - Nicholas Paldino [.NET/C# MVP]
    - nicholas.paldin o@exisconsultin g.com

    "Peter Smith" <petersmith1960 @yahoo.de> wrote in message
    news:5be6f476.0 308180446.621ec 1f3@posting.goo gle.com...[color=blue]
    > 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[/color]


    Comment

    • fvbekkum
      New Member
      • Jul 2006
      • 1

      #3
      Hi, Peter,

      I am extremely interested in what you did, i.e. connect excel to an xml server. :)
      Would you be willing to share your vba code?

      You can contact me at frank@vanbekkum .us

      Comment

      Working...