Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default Downloading stock data

Help,

The follow code runs great in Windows 2000 and Excel 2000. I can download
data for over 3000 stocks in less than 3 seconds. But it doesnt run at all
in Vista 64 bit and Excel 2007. It errors out
in the €ś .Refresh BackgroundQuery:=True €ś line with a €śRun time error 1004
An unexpected error has occurred€ť message. I wasnt expected it, so I guess
it really is unexpected!

CODE
Set AllStockDataWorksheet = Workbooks(1).Worksheets(2)
Set AllStockDataResults = AllStockDataWorksheet.QueryTables _
.Add(Connection:="URL;http://finance.yahoo.com/d/quotes.csv?s=" &
Left(SymbolString, Len(SymbolString) - 1) & "&f=l1va2&e=.csv", _
Destination:=AllStockDataWorksheet.Cells(RowNumber , 51))

With AllStockDataResults
.Refresh BackgroundQuery:=True
End With

Any help will be appreciated.

Duane



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Downloading stock data

This doesn't look right

.Refresh BackgroundQuery:=True

Comment out BackgroundQuery:=True

Unless you need the query to always constantly update in the background
include
.Refresh BackgroundQuery:=False

Regards,
Peter T

"Duane" wrote in message
...
Help,

The follow code runs great in Windows 2000 and Excel 2000. I can download
data for over 3000 stocks in less than 3 seconds. But it doesn't run at
all
in Vista 64 bit and Excel 2007. It errors out
in the " .Refresh BackgroundQuery:=True " line with a "Run time error 1004
An unexpected error has occurred" message. I wasn't expected it, so I
guess
it really is unexpected!

CODE
Set AllStockDataWorksheet = Workbooks(1).Worksheets(2)
Set AllStockDataResults = AllStockDataWorksheet.QueryTables _
.Add(Connection:="URL;http://finance.yahoo.com/d/quotes.csv?s=" &
Left(SymbolString, Len(SymbolString) - 1) & "&f=l1va2&e=.csv", _
Destination:=AllStockDataWorksheet.Cells(RowNumber , 51))

With AllStockDataResults
.Refresh BackgroundQuery:=True
End With

Any help will be appreciated.

Duane





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Downloading stock prices automatically crossfool New Users to Excel 1 October 10th 07 09:02 AM
Downloading Stock Quotes mman493 Excel Worksheet Functions 0 April 30th 07 06:26 PM
Downloading historical stock data from MSN Money to Excel via VBA alui Excel Programming 2 April 29th 06 11:44 PM
downloading data bloc6 Excel Programming 1 March 2nd 06 03:49 PM
Downloading stock prices CMAR Excel Programming 4 August 16th 03 08:08 PM


All times are GMT +1. The time now is 02:44 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"