Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Webquery - Excel 2003

I am using the following script to get the stock quote from yahoo financial
website. This script works fine in my office PC but the same script returns
Run-time error '1004' in my home PC. Both the places I am using Excel 2003
SP2 and Windows XP Professional Version 2002 Service Pack 2:

Sub GetStockQuotes()
With
ActiveWorkbook.ActiveSheet.QueryTables.Add(Connect ion:="URL;http://in.finance.yahoo.com/d/quotes.csv?s=ASHOKLEY.NS&f=l1",
Destination:=ActiveSheet.Cells(1, 1))
.BackgroundQuery = True
.TablesOnlyFromHTML = False
.Refresh BackgroundQuery:=False
.SaveData = True
End With
End Sub

Please advice me how to get rid of the Error.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Webquery - Excel 2003

At a guess, firewall or something to do with your internet connection.

NickHK

"kanind" wrote in message
...
I am using the following script to get the stock quote from yahoo

financial
website. This script works fine in my office PC but the same script

returns
Run-time error '1004' in my home PC. Both the places I am using Excel 2003
SP2 and Windows XP Professional Version 2002 Service Pack 2:

Sub GetStockQuotes()
With

ActiveWorkbook.ActiveSheet.QueryTables.Add(Connect ion:="URL;http://in.financ
e.yahoo.com/d/quotes.csv?s=ASHOKLEY.NS&f=l1",
Destination:=ActiveSheet.Cells(1, 1))
.BackgroundQuery = True
.TablesOnlyFromHTML = False
.Refresh BackgroundQuery:=False
.SaveData = True
End With
End Sub

Please advice me how to get rid of the Error.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Webquery - Excel 2003

Thanks for the response. But if I use the URL
"http://in.finance.yahoo.com/d/quotes.csv?s=ASHOKLEY.NS&f=l1" in IE at home,
I am getting the quote in IE without any problem. Is it still a firewall or
internet connection related problem.


"NickHK" wrote:

At a guess, firewall or something to do with your internet connection.

NickHK

"kanind" wrote in message
...
I am using the following script to get the stock quote from yahoo

financial
website. This script works fine in my office PC but the same script

returns
Run-time error '1004' in my home PC. Both the places I am using Excel 2003
SP2 and Windows XP Professional Version 2002 Service Pack 2:

Sub GetStockQuotes()
With

ActiveWorkbook.ActiveSheet.QueryTables.Add(Connect ion:="URL;http://in.financ
e.yahoo.com/d/quotes.csv?s=ASHOKLEY.NS&f=l1",
Destination:=ActiveSheet.Cells(1, 1))
.BackgroundQuery = True
.TablesOnlyFromHTML = False
.Refresh BackgroundQuery:=False
.SaveData = True
End With
End Sub

Please advice me how to get rid of the Error.




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Webquery - Excel 2003

Try it this way. You may want to replace the actual symbol with a variable


Sub GetStockQuotes()
With ActiveWorkbook.ActiveSheet _
..QueryTables.Add(Connection:= _
"URL;http://in.finance.yahoo.com/d/quotes.csv?s=" & _
"ASHOKLEY.NS&f=l1", Destination:=ActiveSheet.Cells(1, 1))
.BackgroundQuery = True
.TablesOnlyFromHTML = False
.Refresh BackgroundQuery:=False
.SaveData = True
End With

'to delete name buildup
For Each N In ActiveSheet.Names
N.Delete
Next N
End Sub
===========================
With Sheets(2).QueryTables.Add(Connection:="URL;" _
& "http://finance.yahoo.com/d/quotes.csv?s=" & _
symbols & "&f=snd1t1l1ohgpvqyd&e=.csv", _
Destination:=Sheets("Data").Range("b2"))
.BackgroundQuery = True
.TablesOnlyFromHTML = False
.Refresh BackgroundQuery:=False
.SaveData = True
End With
--
Don Guillett
SalesAid Software

"kanind" wrote in message
...
I am using the following script to get the stock quote from yahoo financial
website. This script works fine in my office PC but the same script
returns
Run-time error '1004' in my home PC. Both the places I am using Excel 2003
SP2 and Windows XP Professional Version 2002 Service Pack 2:

Sub GetStockQuotes()
With
ActiveWorkbook.ActiveSheet.QueryTables.Add(Connect ion:="URL;http://in.finance.yahoo.com/d/quotes.csv?s=ASHOKLEY.NS&f=l1",
Destination:=ActiveSheet.Cells(1, 1))
.BackgroundQuery = True
.TablesOnlyFromHTML = False
.Refresh BackgroundQuery:=False
.SaveData = True
End With
End Sub

Please advice me how to get rid of the Error.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Webquery - Excel 2003

As recommended by NickHK, I tried with other ISP Internet connection, now the
script works fine. Thanks

"Don Guillett" wrote:

Try it this way. You may want to replace the actual symbol with a variable


Sub GetStockQuotes()
With ActiveWorkbook.ActiveSheet _
..QueryTables.Add(Connection:= _
"URL;http://in.finance.yahoo.com/d/quotes.csv?s=" & _
"ASHOKLEY.NS&f=l1", Destination:=ActiveSheet.Cells(1, 1))
.BackgroundQuery = True
.TablesOnlyFromHTML = False
.Refresh BackgroundQuery:=False
.SaveData = True
End With

'to delete name buildup
For Each N In ActiveSheet.Names
N.Delete
Next N
End Sub
===========================
With Sheets(2).QueryTables.Add(Connection:="URL;" _
& "http://finance.yahoo.com/d/quotes.csv?s=" & _
symbols & "&f=snd1t1l1ohgpvqyd&e=.csv", _
Destination:=Sheets("Data").Range("b2"))
.BackgroundQuery = True
.TablesOnlyFromHTML = False
.Refresh BackgroundQuery:=False
.SaveData = True
End With
--
Don Guillett
SalesAid Software

"kanind" wrote in message
...
I am using the following script to get the stock quote from yahoo financial
website. This script works fine in my office PC but the same script
returns
Run-time error '1004' in my home PC. Both the places I am using Excel 2003
SP2 and Windows XP Professional Version 2002 Service Pack 2:

Sub GetStockQuotes()
With
ActiveWorkbook.ActiveSheet.QueryTables.Add(Connect ion:="URL;http://in.finance.yahoo.com/d/quotes.csv?s=ASHOKLEY.NS&f=l1",
Destination:=ActiveSheet.Cells(1, 1))
.BackgroundQuery = True
.TablesOnlyFromHTML = False
.Refresh BackgroundQuery:=False
.SaveData = True
End With
End Sub

Please advice me how to get rid of the Error.






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
Webquery Neale Excel Worksheet Functions 3 August 25th 08 05:26 PM
Excel 2000 webquery fails for pages greater than 2k [email protected] Excel Programming 1 August 11th 06 06:17 AM
Webquery datafield naming changed between excel versions 97 and 20 nippetee Excel Programming 0 January 26th 05 12:57 PM
Webquery Othello Excel Discussion (Misc queries) 0 December 1st 04 12:41 PM
Using Webquery via VBA Richard Winston Excel Programming 3 December 2nd 03 12:50 PM


All times are GMT +1. The time now is 06:40 AM.

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

About Us

"It's about Microsoft Excel"