View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Dave[_60_] Dave[_60_] is offline
external usenet poster
 
Posts: 8
Default Web query excel 2003 not good for Excel 2000 code

I wrote some scripts in excel 2000 that used web query and yahoo
finance quotes.
Trying to run the scripts in Excel 2003 is a nightmare. The script
below works fine in
excel 2000 but not 2003. Any help is appreciated.

Also, does anybody know why you can't enter this url in the new web
query window?

http://finance.yahoo.com/d/quotes.cs...l1&ignore=.csv

TIA

Dave


This runs through a column of symbols and retrives the last price and
puts it in the adjacent column to the right.


Sub Yahoo()

Do

On Error Resume Next

x = ActiveCell.Offset(0, -1).Value
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://finance.yahoo.com/d/quotes.csv?s=" & x &
"&f=l1&ignore=.csv", _
Destination:=ActiveCell.Offset(0, 0))
.AdjustColumnWidth = False
.WebFormatting = xlWebFormattingNone
.BackgroundQuery = False
.TablesOnlyFromHTML = True
.Refresh BackgroundQuery:=False
.SaveData = True
End With

ActiveCell.Offset(1, 0).Select
Loop Until IsEmpty(ActiveCell.Offset(0, -1))
End Sub