Hi everyone,
I am working on my first code and I am trying to scrape data from the Federal Reserve.
Here is my code:
Sub CivilianUnemployment() Dim wx As Worksheet: Set ws = Worksheets("API") Dim strURL As String strURL = ws.[FRED] Dim hReq As New WinHttpRequest hReq.Open "GET", strURL, False hReq.Send Dim strReq As String strResp = hReq.ResponseText Dim xmlDoc As New MSXML2.DOMDocument60 If Not xmlDoc.LoadXML(strResp) Then MsgBox "Load error" End If Dim xnodelist As MSXML2.IXMLDOMNodeList Set xnodelist = xmlDoc.getElementsByTagName("observations") Dim xnode As MSXML2.IXMLDOMNode Set xnode = xnodelist.Item(0) Dim obAtt1 As MSXML2.IXMLDOMAttribute Dim obAtt2 As MSXML2.IXMLDOMAttribute Dim xChild As MSXML2.IXMLDOMNode Dim intRow As Integer intRow = 2 Dim strCol1 As String strCol1 = "A" Dim strCol2 As String strCol2 = "B" Dim dtVal As Date Dim dblRate As Double Dim strVal As String Set hReq = Nothing Set xmlDoc = Nothing End Sub
No error messages show up, but when I run the program, nothing happens. If I could get any help for this that would be great. Thank you





Reply With Quote