erikgrave1
New Member
- Joined
- Jul 22, 2015
- Messages
- 9
Hi all,
in this thread we solved, how to read data from an XML file with VBA. Everything was working perfect, until the developer installed a patch for encoding
This is part of working version before the patch, it throws a strange error in .responseText
and this is previous version of XML UTF-8 and working :
<root>
<record type="tsacinv/system">< root>
< record type="tsacinv/system">
< status>in operation
< systemid>S21157648
< /record>
< /root></record>
</root>
And this is the new - not working XML :
< ?xml version="1.0" encoding="iso-8859-1" ?>
< root>
< record type="tsacinv/system">
< status>in operation
< systemid>S21157648
< /record>
< /root>
And the Error in VBA is : run-time error '-107896658 (c00ce56e)'
Do you have any idea how to "format" or "read" and handle the XML as before ?
Thank you all !
in this thread we solved, how to read data from an XML file with VBA. Everything was working perfect, until the developer installed a patch for encoding
This is part of working version before the patch, it throws a strange error in .responseText
Code:
Set XMLdoc = CreateObject("Microsoft.XMLDOM")
XMLdoc.SetProperty "SelectionLanguage", "XPath"
XMLdoc.async = False
With CreateObject("MSXML2.XMLHTTP")
.Open "GET", myURL, False
.Send
[COLOR=#ff0000]XMLdoc.LoadXML .responseText[/COLOR]
End With
Set recordNodes = XMLdoc.SelectNodes("root/record")
For Each recordNode In recordNodes
Cells(row, 2) = recordNode.ChildNodes(1).nodeTypedValue
Cells(row, 3) = recordNode.ChildNodes(0).nodeTypedValue
row = row + 1
Next
x = ""
If row = rowse Then Exit Sub
Next i
and this is previous version of XML UTF-8 and working :
<root>
<record type="tsacinv/system">< root>
< record type="tsacinv/system">
< status>in operation
< systemid>S21157648
< /record>
< /root></record>
</root>
And this is the new - not working XML :
< ?xml version="1.0" encoding="iso-8859-1" ?>
< root>
< record type="tsacinv/system">
< status>in operation
< systemid>S21157648
< /record>
< /root>
And the Error in VBA is : run-time error '-107896658 (c00ce56e)'
Do you have any idea how to "format" or "read" and handle the XML as before ?
Thank you all !