Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In vbs, I can parse an XML file with the following code:
Set xmlDoc = CreateObject("MSXML2.DOMDocument.4.0") If (IsObject(xmlDoc) = False) Then alert("DOM document not created. Check MSXML version used in createXmlDomDocument.") End If xmlDoc.async = False xmlDoc.validateOnParse=False xmlDoc.load xmlFile If xmlDoc.parseError.errorcode = 0 Then 'Walk from the root to each of its child nodes: treeWalk(xmlDoc) Else Wscript.echo "There was an error in : " & xmlFile &" Line: " & xmlDoc.parseError.line & " Column: " & xmlDoc.parseError.linepos End If Function treeWalk(node) For Each child In node.childNodes If (child.hasChildNodes) Then treeWalk(child) End If Next End Function When I try to do this in Excel VBA, it chokes on the line "treeWalk(xmlDoc)" saying Object doesn't support this property or method. I tried changing the function definition to include As all-sorts-of-things, no change. I do have Microsoft XML 4.0 included in the VBA Project References. I'm obviously overlooking something basic (Visually Basic, that is). Can someone point me in the right direction? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
PT Sum of Difference | Excel Discussion (Misc queries) | |||
sum difference | Excel Discussion (Misc queries) | |||
subtract the time difference from another time difference | Excel Discussion (Misc queries) | |||
charting a difference of 2 columns' w/o adding a difference column | Charts and Charting in Excel | |||
What's the difference here? | Excel Programming |