View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] jbesr1230@hotmail.com is offline
external usenet poster
 
Posts: 1
Default maximum as to the csv data that can be downloaded in to Excel

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.