Run Time Error 1004 with Excel Web Query Macro

G

Guest

I am running a EXCEL macro to automate web query. It is a simple macro. The
trouble is sometimes it runs fine but other times it gives run time error
1004. Typically when I quit Excel and reload it and rerun it runs. I highly
appreciate any suggestions. Thanks very much in advance

Here is my code:

Sub Try200()
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://finance.yahoo.com/q/pr?s=[""Quote"",""Enter Stk Symbols""]", _
Destination:=ActiveCell)
.WebTables = "33"
.BackgroundQuery = True
.TablesOnlyFromHTML = True
.Refresh BackgroundQuery:=False
.SaveData = True
End With
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top