Announcement

Collapse
No announcement yet.

Run-time error 1004 Table Cannot Overlap A Range...

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Run-time error 1004 Table Cannot Overlap A Range...



    I used the macro recorder in Excel 2007 to record the code below. The code is supposed to use a .iqy to pull data from a SharePoint 2007 site. When I run the macro, I receive the following error: A table cannot overlap a range that contains a PivotTable report, query results, protected cells or another table. I have no issue running the .iqy query from excel without using the macro. Any idea what's causing the 1004 error?


    Sub Macro1()
    With ActiveSheet.ListObjects.Add(SourceType:=0, Source:= _
    "OLEDB;Provider=Microsoft.Office.List.OLEDB.2.0;", Destination:=Range("A1"))
    .QueryTable
    .CommandType = 5
    .CommandText = Array( "{9848425C-7548-45D7-97F6-0F39962103AD}{F0102C5F-57BF-4023-B2D0-FF93F04A0030}

  • #2


    Re: Run-time error 1004 Table Cannot Overlap A Range...

    Sorry, my code kept getting cut off with or without code tags. See Macro1 in attached file to examine the full code I'm using.

    Thanks!
    Attached Files

    Comment

    Working...
    X