Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Web Query Error 1004 - Cannot insert columns...


I'm running a macro that runs multiple webqueries.... pulling the table
data onto the same active sheet.

After it runs thru x number of times, I get a a 1004 - Cannot insert
columns because column IV has data etc...

Looking at the active sheet i see that with evey new web query, the old
one is pushed a few columns to the right, which eventually fills the
page.

How can I avoid this?

Here is the code I'm using to insert the webquery
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;" & webaddy, _
Destination:=Range("aA1"))

.BackgroundQuery = False
.TablesOnlyFromHTML = False
.Refresh BackgroundQuery:=False
.SaveData = False
End With



--
Steach91
------------------------------------------------------------------------
Steach91's Profile: http://www.excelforum.com/member.php...o&userid=30234
View this thread: http://www.excelforum.com/showthread...hreadid=499121

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 91
Default Web Query Error 1004 - Cannot insert columns...

Try this:

With ActiveSheet.QueryTables.Add(Connection:= _
"URL;" & webaddy, _
Destination:=Range("aA1"))

'----New code
.RefreshStyle = xlOverwriteCells

.BackgroundQuery = False
.TablesOnlyFromHTML = False
.Refresh BackgroundQuery:=False
.SaveData = False
End With

Does that help?

***********
Regards,
Ron

XL2002, WinXP-Pro


"Steach91" wrote:


I'm running a macro that runs multiple webqueries.... pulling the table
data onto the same active sheet.

After it runs thru x number of times, I get a a 1004 - Cannot insert
columns because column IV has data etc...

Looking at the active sheet i see that with evey new web query, the old
one is pushed a few columns to the right, which eventually fills the
page.

How can I avoid this?

Here is the code I'm using to insert the webquery
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;" & webaddy, _
Destination:=Range("aA1"))

.BackgroundQuery = False
.TablesOnlyFromHTML = False
.Refresh BackgroundQuery:=False
.SaveData = False
End With



--
Steach91
------------------------------------------------------------------------
Steach91's Profile: http://www.excelforum.com/member.php...o&userid=30234
View this thread: http://www.excelforum.com/showthread...hreadid=499121


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
'07 Large Operation Error (Delete / Insert Rows and/or Columns) Elgee Excel Discussion (Misc queries) 4 April 23rd 23 09:02 PM
Runtime 1004 error -- insert method of range class failed. tish Excel Discussion (Misc queries) 1 June 1st 07 04:04 PM
run-time error '1004': Application-defined or object-deifined error [email protected] Excel Programming 5 August 10th 05 09:39 PM
Help with error 1004 in database query Alex Zhang Excel Programming 1 August 14th 04 12:46 AM


All times are GMT +1. The time now is 06:44 PM.

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

About Us

"It's about Microsoft Excel"