how do you break the link with MS Query - Database via code

J

JulieD

Hi

i have a spreadsheet that draws information from an access database and then
is "saved as" a new workbook - i would like to (programmatically) break the
link (ie untick save query definition) after the save as. I've done a
google search and found a post by Tom Ogilvy that mentions a code solution
but i couldn't find it anywhere.

if this is not possible any other "workarounds"?
Thanks.

Cheers
JulieD
 
G

Gjones

Hi JulieD;

Right click somewhere in the returned range and select
Data Range Properties. You will find the options there to
turn it off.

Thanks,

Greg
 
T

Tom Ogilvy

Activesheet.QueryTables(1).Delete

will delete the querytable definition, but leave the data. It seems that is
what you want.
 
Top