Using Excel 2010 with VBA 7.0
Code in this video works until I get to 10:01. When execute the line
Dim Resp As String: Resp = Http.ResponseText
I get a Runtime error 91 Object variable or With block variable not set.
Question: How do I resolve this error message?
Private Sub btnRefresh_Click()
Dim W As Worksheet: Set W = ActiveSheet
Dim Last As Integer: Last = W.Range("A100").End(xlUp).Row
Dim Symbols As String
Dim i As Integer
Dim URL As String
Dim Http As WinHttpRequest
If Last = 1 Then Exit Sub
For i = 2 To Last
Symbols = Symbols & W.Range("A" & i).Value & "+"
Next i
Symbols = Left(Symbols, Len(Symbols) - 1)
URL = "http://finance.yahoo.com/d/quotes.csv?s=" & Symbols & "&f=snl1hg"
Http = New WinHttpRequest
Http.Open "GET", URL, False
Http.Send
Dim Resp As String: Resp = Http.ResponseText
Debug.Print Symbols
Debug.Print URL
End Sub