runtime error 1004 HELP PLS

M

Marcelo P

I have excel macro that when I run it for the first time it works
fine, but all the even number of times I try to run it, I receive
runtime error 1004".
For example, the first time it runs ok, the second it crashes, but the
third it runs ok again, and so on.

Can anybody help me with this problem.

Thanks a lot

The code is below

Sub new()

qURL = "http://sitesafari.com/api/?
action=getGrps&usnm=mpochin&pw=master&format=HTML_Table"

With ActiveSheet.QueryTables.Add(Connection:="URL;" &
qURL, _
Destination:=Range("A1"))
.BackgroundQuery = True
.TablesOnlyFromHTML = False
.Refresh BackgroundQuery:=False
.SaveData = True


End With
End Sub
 

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