maximum as to the csv data that can be downloaded in to Excel

J

jbesr1230

Hello,
When I run a query to download some stock data from Yahoo, (see code
below), I get " Run-time error '1004' An unexpected error has
occurred.
I hit "debug" and "Refresh BackgroundQuery:=False" is
highlighted. This does not happen if there are few symbols but if
there are many symbols I get this error. Is there a maximum as to the
csv data that can be downloaded into Excel? Is there some code I can
add to avoid this error?




With Sheets("sheet1").QueryTables.Add(Connection:="URL;" _
& "http://finance.yahoo.com/d/quotes.csv?s=" & _
symbols & "&f=sn11&e=.csv", _
Destination:=Sheets("sheet1").Range("b3"))


.BackgroundQuery = True
.TablesOnlyFromHTML = False
.Refresh BackgroundQuery:=False
.SaveData = True
End With

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top