ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   runtime error 1004 HELP PLS (https://www.excelbanter.com/excel-discussion-misc-queries/143738-runtime-error-1004-help-pls.html)

Marcelo P

runtime error 1004 HELP PLS
 
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


Gerigto

runtime error 1004 HELP PLS
 
http://support.microsoft.com/kb/210684
--
TG


"Marcelo P" wrote:

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



Marcelo P

runtime error 1004 HELP PLS
 
On May 22, 10:48 pm, Gerigto
wrote:
http://support.microsoft.com/kb/210684
--
TG



"Marcelo P" wrote:
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
runtimeerror1004".
For example, the first time it runs ok, the second it crashes, but the
third it runs ok again, and so on.


Can anybodyhelpme 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- Hide quoted text -


- Show quoted text -


Thanks Gerigto,
I followed the instructions but I cannot get it to work,
Could anybody tell me how to modify the code so it will work.

Thank you all



All times are GMT +1. The time now is 10:51 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com