I'm attempting to merge two scripts to accomplish the following.
Run a http address to obtain stock data, based off a list of tickers on a table in my dB and save as a text file named as the ticker symbol.
Have the process loop until the list has been completely worked.
The following is the code I am working with (apologize in advance, it's probably horrible):
Private Sub GrabQuotes()
Dim oXMLHTTP
Dim oStream
Dim Symbol As String
Dim i As Integer
Set oXMLHTTP = CreateObject("MSXML2.XMLHTTP.3.0")
With Table("Ticker")
For i = 1 To 55
Symbol = .Fields(i, 4).Value
oXMLHTTP.Open "GET", "http://finance.google.com/finance/info?client=ig&q=" & Symbol, False
oXMLHTTP.Send
If oXMLHTTP.Status = 200 Then
Set oStream = CreateObject("ADODB.Stream")
oStream.Open
oStream.Type = 1
oStream.Write oXMLHTTP.responseBody
oStream.SaveToFile "\\HBFSBOS\APPS\TDID\StockQuotes\" & Symbol & ".txt"
oStream.Close
End If
Next i
End With
End Sub
No matter what changes I try to make to it, I keep getting errors. Can anyone spot what I am doing wrong?