ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   maximum as to the csv data that can be downloaded in to Excel (https://www.excelbanter.com/excel-programming/331634-maximum-csv-data-can-downloaded-excel.html)

[email protected]

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.



All times are GMT +1. The time now is 12:43 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com