|
-
Nov 11th, 2012, 09:37 AM
#1
Thread Starter
Hyperactive Member
How to handle: 'A query with this name already exists...'
I keep getting this message ("'A query with this name already exists on this sheet") even though I am deleting all visible queries within this workbook. How can I delete all external data queries so that this error does not occur? Thanks.
-
Nov 11th, 2012, 10:05 AM
#2
Thread Starter
Hyperactive Member
Re: How to handle: 'A query with this name already exists...'
I can't rerun the same data import query without either manually renaming the query within the properties window or deleting the worksheet. No matter what I try I cannot see the query anywhere, but its name contains the name of the text file I imported.
Last edited by doasidont; Nov 11th, 2012 at 10:10 AM.
-
Nov 11th, 2012, 01:50 PM
#3
Thread Starter
Hyperactive Member
Re: How to handle: 'A query with this name already exists...'
More info. Seems like if you delete the external data query after you run it, you can run the same query to the same external file again. But if you save the workbook without deleting the query, that query stays forever and cannot be found and deleted unless you delete the entire sheet.
-
Nov 14th, 2012, 11:51 AM
#4
Addicted Member
Re: How to handle: 'A query with this name already exists...'
Run this to delete all queries on the active sheet:
Code:
While ActiveSheet.QueryTables.Count
ActiveSheet.QueryTables(1).Delete
Wend
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|