I watched the following video and input the same code. For some reason, I'm getting a "run-time error 424 - object required". I can't figure out what's wrong with the code and why it won't return the same value as the video from the Yahoo site
https://www.youtube.com/watch?v=IOzHacoP-u4
Pasted the code below:
Sub Get_Web_Data()
Dim request As Object
Dim response As String
Dim html As New HTMLDocument
Dim price As Variant
'Website to go to.
website = "https://finance.yahoo.com/quote/EURUSD=X/"
' Create the object that will make the webpage request.
Set request = CreateObject("MSXML2.XMLHTTP")
' Where to go and how to go there - probably don't need to change this.
request.Open "Get", website, False
'Get fresh data
request.setRequestHeader "If-Modified-Since", "Sat, 1 Jan 2000 00:00 GMT"
' Send the request for the webpage.
request.send
' Get the webpage response data into a variable.
response = StrConv(reuest.responseBody, vbUnicode)
' Put the webpage into an html object to make data references easier.
html.body.innerHTML = response
' Get the price from the specified element on the page.
price = html.getElementsByClassName("Trsdu(0.3s) Fw(b) Fz(36px) Mb(-4px) D(ib)")(0).innerText
' Output the price into a message box.
MsgBox price
End Sub