Ok, different approach . Let's see if this works … does work with stored data in b2 so I hope it will work with mynode.txt too .
Sub testing_stuff() 'Get manufacturer informationSet mynode = oXMLFile.SelectSingleNode("/NessusClientData_v2/Report/ReportHost/ReportItem[@pluginID='24270']/plugin_output")
'***
'for testing purposes I stored B2 in a variable
'I think you need to alter every mynode into mynode.txt if you want to use this in your coding
'and delete next line and messageboxes or put ' in front of the line
mynode = ActiveSheet.Range("B2").Text
'If Not mynode Is Nothing Then
'*** changed stuff, now I'm looking for keywords inside mynode.text --- parsed from xml
'this one is is the variable with all the stuff extracted from that xml file
MsgBox Split(mynode, ":")(0)
'just testing
MsgBox Split(mynode, "Manufacturer :")(1)
'Here I look for the keyword Manufacturer : --- since this keyword is 14 letters long I add 14 positions to the start
'of the info we want
'Than I look for the second keyword in your file and subtract the beginning - 14
'so if 2nd keyword starts at 53 and first is 30 than we have : start 30 + 14 = 44 --- end = 53 - 44 = length of data we search
MsgBox Mid(mynode, InStr(1, mynode, "Manufacturer :") + 14, _
InStr(1, mynode, "Computer Model :") - InStr(1, mynode, "Manufacturer :") - 14)
Manufacturer = Mid(mynode, InStr(1, mynode, "Manufacturer :") + 14, _
InStr(1, mynode, "Computer Model :") - InStr(1, mynode, "Manufacturer :") - 14)
MsgBox Manufacturer
MsgBox Mid(mynode, InStr(1, mynode, "Computer Model :") + 16, _
InStr(1, mynode, "Computer SerialNumber :") - InStr(1, mynode, "Computer Model :") - 16)
MsgBox Mid(mynode, InStr(1, mynode, "Computer SerialNumber :") + 23, _
InStr(1, mynode, " ") - InStr(1, mynode, "Computer Serialnumber :") - 23)
'MsgBox Manufacturer
'MsgBox ModelNum
'MsgBox SerialNum
'End If
End Sub
Charlize