+ Reply to Thread
Results 1 to 2 of 2

Web Query Error 1004 - Cannot insert columns...

  1. #1
    Registered User
    Join Date
    01-07-2006
    Posts
    26

    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

  2. #2
    Ron Coderre
    Guest

    RE: 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1