Hello,
I am have here a code provided by JasperD (@thanks) to retrieve an actual price of a stock from Google Finance.
Function StockQuote(ByVal Stock)
Dim URL As String
Dim http As New MSXML2.XMLHTTP
Dim stockdoc As New HTMLDocument
URL = "https://www.google.com/finance?q=" & Stock
http.Open "GET", URL, False
http.Send
stockdoc.body.innerHTML = http.ResponseText
StockQuote = stockdoc.getElementsByClassName("pr")(0).innerText
Set http = Nothing
End Function
Unfortunetlly when I try to make it run it appears a "Compile error: User-defined type not defined." on the second line of the code "Dim http As New MSXML2.XMLHTTP"
I believe I've omited include some refrences.
Here's what I've additionaly mark off in Tools-References:- Microsoft XML, v6
- Microsoft HTML Object Library
Does somebody know what I've done worng?
Thank you in advance.
Bookmarks