travellerva
New Member
- Joined
- Mar 31, 2012
- Messages
- 47
- Office Version
- 365
- Platform
- MacOS
I have vba macro that makes a web request for stock option quotes as follows:
The web call returns a text string in CSV format. My intent is to spread the CSV data down column A. This code doesn't work - it returns the CSV formatted data as a single string inside cell A1. What am I missing?
Thanks in advance for any suggestions and help.
Code:
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;https://query2.finance.yahoo.com/v7/finance/options/" & UnderlyingSymbol & "?date=" & ExpiryEpoch & "", _
Destination:=Range("A1"))
.BackgroundQuery = True
.TablesOnlyFromHTML = True
.TextFileStartRow = 2
.TextFileParseType = xlDelimited
.TextFileCommaDelimiter = True
.Refresh BackgroundQuery:=False
.SaveData = True
End With
The web call returns a text string in CSV format. My intent is to spread the CSV data down column A. This code doesn't work - it returns the CSV formatted data as a single string inside cell A1. What am I missing?
Thanks in advance for any suggestions and help.
Last edited: