When XML parsing special characters - my specific issue is with ampersands - Excel VBA is throwing the error
Run time error 91: Object variable or With block variable not set
PHP code for XML Parsing:
$xml = '<?xml version="1.0" encoding="UTF-8" ?>
<root> <EngineerFName>'.$engineer_fname.'</EngineerFName>
<CustomerName>'.$customer_name.'</CustomerName>
<EngineerLName>'.$engineer_lname.'</EngineerLName>
<TopName>'.$dt_top_name.'</TopName>
</root>';
Excel Vba code:
Dim XDoc1 As Object
Dim XHTML1 As IHTMLElement
Dim XURL1 As String
Dim CustomerName1 As String
Set XDoc1 = CreateObject("MSXML2.DOMDocument")
XDoc1.async = False: XDoc1.validateOnParse = False
XDoc1.Load ("http://www.beamon.com/windows_application/macro2.php" + "?Id=" + Sheets(1).Range("D2"))
Set lists = XDoc1.DocumentElement
Set getFirstChild = lists.FirstChild
Set getCustomerName1 = lists.ChildNodes(1)
Set getEnglname = lists.ChildNodes(2)
Set getTopCustomer = lists.ChildNodes(3)
Sheets(1).Range("T5") = getCustomerName1.text
Sheets(1).Range("T6") = getFirstChild.text & Space(1) & getEnglname.text
Sheets(1).Range("T7") = getTopCustomer.text
Set XDoc1 = Nothing
Can anyone suggest a solution?