+ Reply to Thread
Results 1 to 3 of 3

Delete Querry Table Report using wildcard

  1. #1
    Forum Contributor
    Join Date
    12-10-2008
    Location
    Austin
    Posts
    660

    Delete Querry Table Report using wildcard

    In order for me to create a filter list on my worksheet, I'm having to first delete
    a querry report that's being stored/generated from the data being imported into my
    workbook.
    Due to Run-Time Error'1004
    A list cannot overlap a range that contains a pivotTable report,query results,protected cells or another list.
    Initially, I only had 1 ActiveSheet.QueryTable to delete ("IN Stock Status Report - 6896_12"), but this also changed when I ran on another PC under someone else's account.

    I'm hoping that maybe I can use a wildcard "in the sense" to delete all occurrences that
    may appear.

    The following are macros recorded to log what's needing to be deleted.
    Please Login or Register  to view this content.

    Please Login or Register  to view this content.
    I'm hoping for something like this:

    ActiveSheet.QueryTables("IN Stock Status Report - 6896_*").Delete
    ..but that does not work.

    Here's a bit of code that brings in the querry report.

    Please Login or Register  to view this content.
    Any help is appreciated.

    Thanks,

    BDB
    Last edited by bdb1974; 02-23-2010 at 04:59 PM.

  2. #2
    Forum Contributor
    Join Date
    12-10-2008
    Location
    Austin
    Posts
    660

    Re: Delete Querry Table Report using wildcard

    I may should have titled this thread as,"Delete or remove external data connections"

    Since my data is brough in by a query, I need to disassociate the sheet with the query in order to add a list.

    ...Maybe I should just say.. while attempting to create my list, I get a msg box stating:"Your selection contains one or more external data ranges.
    Do you want to convert the selection to a list and remove all external connections?"

    After selecting "Yes" my list is made. I'd like to be able to do this automatically through a macro

    Hope this makes sense.

    BDB
    Last edited by bdb1974; 02-15-2010 at 01:27 PM.

  3. #3
    Forum Contributor
    Join Date
    12-10-2008
    Location
    Austin
    Posts
    660

    Re: Delete Querry Table Report using wildcard

    Hi all,

    ...just want to share my latest resolvement.


    The following code deletes all queries within a workbook.
    I found the code here: http://www.*****-clicks.com/excel/ExternalData4.htm
    Please Login or Register  to view this content.
    This seems to have fixed my problem w/o having to use a (*) to define/name each querry table link needing to be removed.
    Now I can build my filter list w/o any manual manipulation/ interruption.

    Regards,

    BDB
    Last edited by bdb1974; 02-23-2010 at 05:01 PM.

+ 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