DISABLE "SAVE QUERY DEFINITION"

K

keram01

Is it possible to disable "save query definition" through macro.
Basically I do not want any external data links saved in define names
when I run query through macro.

Thanks
 
R

Rob van Gelder

This deletes all querytables from ActiveSheet

Dim qtb As QueryTable

For Each qtb In ActiveSheet.QueryTables
qtb.Delete
Next

This approach will leave behind the named range for the querytable.

If you're managing QueryTables you may be interested in the Query Editor
Add-In on my website.
 

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