ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   how do you break the link with MS Query - Database via code (https://www.excelbanter.com/excel-programming/301180-how-do-you-break-link-ms-query-database-via-code.html)

JulieD

how do you break the link with MS Query - Database via code
 
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



GJones

how do you break the link with MS Query - Database via code
 
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
-----Original Message-----
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


.


Tom Ogilvy

how do you break the link with MS Query - Database via code
 
Activesheet.QueryTables(1).Delete

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


--
Regards,
Tom Ogilvy


"JulieD" wrote in message
...
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





JulieD

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

thanks - perfect - just what i was after.

Cheers
JulieD

"Tom Ogilvy" wrote in message
...
Activesheet.QueryTables(1).Delete

will delete the querytable definition, but leave the data. It seems that

is
what you want.


--
Regards,
Tom Ogilvy


"JulieD" wrote in message
...
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








All times are GMT +1. The time now is 05:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com