Web Query Error 1004 - Cannot insert columns...

S

Steach91

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
 
R

Ron Coderre

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
 

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