Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 618
Default 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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 132
Default 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


.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 618
Default 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






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do break the link from my excel workbook to a access database. Vernon Excel Discussion (Misc queries) 4 November 17th 07 06:26 AM
database query not showing foxpro database How I import data mangat New Users to Excel 1 June 24th 07 03:31 PM
Moved database, how do I change link to the database in excel Toastrack Excel Discussion (Misc queries) 0 October 20th 06 09:36 AM
Anyone Else Use Database Query to Query Another Sheet in the Same Excel Workbook? jocke Excel Discussion (Misc queries) 1 November 29th 05 01:44 PM
Anyone Else Use Database Query to Query Another Sheet in the Same Excel Workbook? jocke Excel Discussion (Misc queries) 0 November 28th 05 06:37 PM


All times are GMT +1. The time now is 03:46 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"