ConststrPath = "D:\Test\"
Sub
XML()
Dim
nodeXML
As
Object
Dim
x
As
Integer
Dim
StrFilename
As
Variant
StrFilename = Dir(
"D:\Test\*.xml"
)
Do
While
StrFilename<>
""
Set
xmlDoc = CreateObject(
"Microsoft.XMLDOM"
)
xmlDoc.setProperty
"SelectionLanguage"
,
"XPath"
xmlDoc.Load(strPath & StrFilename)
Set
nodeXML = xmlDoc.getElementsByTagName(
"ID"
)
For
i = 0
To
nodeXML.Length - 1
Sheets(1).Cells(x + 1,
"A"
).Value = nodeXML(i).Text
Next
StrFilename = Dir
Loop
End
Sub