I am trying to create a table of data in Excel from an API XML data pull. Prior to the code below I make the API call, and the first line below presents a msgbox with the XML data (so that part appears to be working).
MsgBox httpReq.responseText
Dim xDoc As MSXML2.DOMDocument
Set xDoc = New MSXML2.DOMDocument
xDoc.async = False
xDoc.validateOnParse = False
If xDoc.Load(httpReq.responseText) Then
'Do something
Else
MsgBox "Document failed to load."
End If
Unfortunately I then keep hitting the Else side of that If/Then (i.e. the document is not loading). Do I have that syntax wrong? In my research efforts, it seems the parameter of the .Load() is usually a file or URL--can I not use the httpReq.responseText in place of a file name or URL?