Hi everyone. Working on a mac in Excel 2016, and looking for a way to create a user defined function to pull in data from Yahoo Finance API. Searched all over the web, and it is quite easy to do this on a PC, but there is sparse information on how to accomplish this on a mac. Any help would be greatly appreciated. It is basically the call to the external data source that I cant seem to figure out.
The following works fine on my non-mac machine. I'm looking for the equivalent that will work on my mac.
Function StockQuote(strTicker As String)
Dim strURL As String, strCSV As String
Dim dbClose As Double
' Compile the request URL
strURL = "http://download.finance.yahoo.com/d/quotes.csv?s=" & strTicker & "&f=l1"
Set http = CreateObject("MSXML2.XMLHTTP")
http.Open "GET", strURL, False
http.Send
strCSV = http.responseText
dbClose = Val(strCSV)
StockQuote = dbClose
Set http = Nothing
End Function
The following works fine on my non-mac machine. I'm looking for the equivalent that will work on my mac.
Function StockQuote(strTicker As String)
Dim strURL As String, strCSV As String
Dim dbClose As Double
' Compile the request URL
strURL = "http://download.finance.yahoo.com/d/quotes.csv?s=" & strTicker & "&f=l1"
Set http = CreateObject("MSXML2.XMLHTTP")
http.Open "GET", strURL, False
http.Send
strCSV = http.responseText
dbClose = Val(strCSV)
StockQuote = dbClose
Set http = Nothing
End Function