Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default External Data Updates

I have an excel template which pulls some data from my SQL server when
opened. I need to set it so that it only pulls up the data when first opened
from a template, but not after being saved as an xls file.

Any ideas?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default External Data Updates

ActiveSheet.QueryTables(1).Delete

after you refresh the data.

--
Regards,
Tom Ogilvy

<M.Streeks wrote in message
...
I have an excel template which pulls some data from my SQL server when
opened. I need to set it so that it only pulls up the data when first

opened
from a template, but not after being saved as an xls file.

Any ideas?




  #3   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default External Data Updates

Thanks for your help - I'm still not sure how to do it though.
Does that get pasted in verbatim? and where exactly do i put it?

The code that i use to populate the tables is in a module - i don't program
with excel very often, so i don't really know where every thing goes.



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

after you refresh the data.

--
Regards,
Tom Ogilvy

<M.Streeks wrote in message
...
I have an excel template which pulls some data from my SQL server when
opened. I need to set it so that it only pulls up the data when first

opened
from a template, but not after being saved as an xls file.

Any ideas?






  #4   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default External Data Updates

Now i only need to know where to put it.

<M.Streeks wrote in message ...
Thanks for your help - I'm still not sure how to do it though.
Does that get pasted in verbatim? and where exactly do i put it?

The code that i use to populate the tables is in a module - i don't

program
with excel very often, so i don't really know where every thing goes.



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

after you refresh the data.

--
Regards,
Tom Ogilvy

<M.Streeks wrote in message
...
I have an excel template which pulls some data from my SQL server when
opened. I need to set it so that it only pulls up the data when first

opened
from a template, but not after being saved as an xls file.

Any ideas?








  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default External Data Updates

I would guess either in the open event of the template - you would have to
include code to do the query with backgroundrefresh set to false, the code I
gave you to delete the query table on that sheet (this all assumes you are
using a querytable). Then possibly save the template as a workbook with a
new name.

http://www.cpearson.com/excel/events.htm

--
Regards,
Tom Ogilvy

<M.Streeks wrote in message ...
Now i only need to know where to put it.

<M.Streeks wrote in message

...
Thanks for your help - I'm still not sure how to do it though.
Does that get pasted in verbatim? and where exactly do i put it?

The code that i use to populate the tables is in a module - i don't

program
with excel very often, so i don't really know where every thing goes.



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

after you refresh the data.

--
Regards,
Tom Ogilvy

<M.Streeks wrote in message
...
I have an excel template which pulls some data from my SQL server

when
opened. I need to set it so that it only pulls up the data when

first
opened
from a template, but not after being saved as an xls file.

Any ideas?










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
External Data Warning Message - I have No External Data in wrkbk Cass_makeitfun[_2_] Excel Discussion (Misc queries) 0 May 12th 10 09:02 PM
Getting External Data based on criteria insde of the external data BigMacExcel Excel Discussion (Misc queries) 0 August 31st 09 06:41 PM
Excel 2003 - Protecting Cells but allowing external data updates watermt Excel Worksheet Functions 3 August 3rd 09 05:31 PM
Data Validation Updates LiAD Excel Worksheet Functions 7 January 14th 09 10:37 PM
Data Updates With Date Boxer Excel Discussion (Misc queries) 1 November 30th 07 12:17 PM


All times are GMT +1. The time now is 08:52 PM.

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

About Us

"It's about Microsoft Excel"