Excel VBA XML check siblings within parent node

kinobay

New Member
This may be a dumb question, but I could use some help with this problem. After some looking around I have my program doing the basics of what I need (pulling data from an xml file into excel using vba).The code below is the basics of what I'm doing based on the xml sample below that.
As I find each Concentration value, is there an easy way to check the sibling associated with the sibling under each parent as I loop through?(Hopefully I have formatted this post so the code/xml example show up legibly).
Let me know if I haven't explained something clearly or the code example doesn't show up properly. Thanks in advance for any help.\[code\]Dim d As DOMDocument60Dim i As IXMLDOMNodeListDim n As IXMLDOMNodeSet d = New DOMDocument60d.Load FilePathName Set i = d.SelectNodes("SampleReport/CompoundData/Conc")For Each n In i ConcVar = n.TextNext n<SampleReport><CompoundData> <CompoundName>AAA</CompoundName> <Conc>120</Conc> <CompoundType>T</CompoundType></CompoundData><CompoundData> <CompoundName>BBB</CompoundName> <Conc>200</Conc> <CompoundType>T</CompoundType></CompoundData><CompoundData> <CompoundName>CCC</CompoundName> <Conc>30</Conc> <CompoundType>T</CompoundType></CompoundData><CompoundData> <CompoundName>DDD</CompoundName> <Conc>400</Conc> <CompoundType>T</CompoundType></CompoundData></SampleReport>\[/code\]
 
Back
Top