Excel VBA – How do you span a large multi line XML string to many rows or as XML import.
I’m interogating a server for information which is responding with the required XML information.
So without truncation I need to either:
- Embed the results as an imported XML file.
- Populate each row by each line.
Dim sht As Worksheet
Dim authKey As String
authKey = “KEYREMOVED”
Set sht = Sheet1
Dim strUrl As String
strUrl =
Set hReq = CreateObject(“MSXML2.XMLHTTP”)
With hReq
.Open “GET”, strUrl, False
.SetRequestHeader “Authorization”, “Bearer ” & authKey
.Send
End With
Dim response As String
response = hReq.ResponseText
MsgBox response
'Sheets("Sheet1").Range("A1").Value = response
End Sub
** Using the last command puts all the result into the cell and further truncates.
(Searching the web keeps bringing up doing it via non-vba ways)
** Using the last command puts all the result into the cell and further truncates.
Alan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.