I am trying to parse an api URL using VBA. However, cannot figure out why I get no output with the below code. No error message either. If I use another XML file it seems to work, however..
Any tips from someone of code improvement? THanks!
Sub testing()
Dim http As New XMLHTTP60
Dim xmlDoc As Object, post As Object
With http
.Open "GET", "https://www.researchonline.se/api/MacroAdmin/GetForecast?name=policy&start=Mon%20Sep%2014%202020&end=Tue%20Sep%2014%202021", False
.send
Set xmlDoc = CreateObject("MSXML2.DOMDocument")
xmlDoc.loadXML .responseXML.XML
End With
For Each post In xmlDoc.getElementsByTagName("dateStarts")
r = r + 1:
Cells(r, 1) = post.getElementsByTagName("d3p1:dateTime").Text
MsgBox post.getElementsByTagName("d3p1:dateTime").Text
Next post
End Sub