D
Dave
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.csv?s=IBM&f=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
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.csv?s=IBM&f=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