I'm attempting to extract a table of historical stock prices to bring into a an Excel worksheet. I'm currently using Excel for Mac so activex / com objects are not supported, which is why I have had to go this route. If I use a different URL it extracts the table information just fine, and visiting the URL directly in browser works fine, but if I try to extract historical price information Excel throws a VB error 1004.
HistoryURL = "URL:https://finance.yahoo.com/quote/AAPL/history?period1=1577836800&period2=1609459200&interval=1d&filter=history&frequency=1d&includeAdjustedClose=true"
With .QueryTables.Add(Connection:=HistoryURL, Destination:=.Range("Z1"))
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlOverwriteCells
.SavePassword = False
.SaveData = False
End With
What am I missing here?
question from:
https://stackoverflow.com/questions/65601186/excel-not-extracting-table-of-historical-stock-prices-from-yahoo-finance 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…