LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
Ed Ed is offline
external usenet poster
 
Posts: 399
Default Remove/disable event macros in SavedAs wkbk?

Thanks for the explanation, Dave. I've never explored .xlt files. I guess
I throw around the label "template" too easily - to me, it's just a
boiler-plate file that gets filled in and saved. But there's probably some
aspects of functionality that I'm missing by not using the .xlt format.
I'll have to study that.

Ed

"Dave Peterson" wrote in message
...
If you really create a new workbook based on a .xlt file, then it won't

have a
path.

Just like clicking on the New Icon on the standard toolbar creates a

workbook
called book#. It doesn't have an extension and doesn't have a path.

If you open the template with File|open, then you'll be really opening the
template to edit it--not as a basis for a new workbook.

File|New then pointing to that template file or double clicking on the

*.xlt
file in windows explorer should create a new workbook based on that

template.

Ed wrote:

Thanks, Ben and Dave. I've got the IF in there, based on the workbook

name,
but it seemed there might be a better way. The file is not a .xlt; just

a
.xls that is opened, written to via UserForms, and SavedAs. I might

check
out the tips from Chip Pearson - I might be able to remove the code

before
the save so the new workbook doesn't have it.

Dave - why would a .xlt file have no path? Doesn't it have to exist
somewhere?

Ed

"Dave Peterson" wrote in message
...
Chip Pearson has some instructions on how to remove code on the fly.
http://www.cpearson.com/excel/vbe.htm

But I like Ben's suggestion, too.

If the template is really a template (*.xlt) and the workbook that's

created is
really a new workbook based on that template, you can check the path

of
that
workbook. If it's = "", then the workbook hasn't been saved and you c

an
do your
stuff.

option explicit
sub workbook_open()
if me.path < "" then
exit sub
end if

'keep going
end sub


Ed wrote:

I have a "master template" workbook. When the user fills in certain
information, the workbook generates a name for itself and performs a

SaveAs
NewFileName.

The master has Open, Close, and Worksheet_Change events that are not

needed
in the new workbooks. Is there an easy way to remove or disable

these
event
codes when the new workbook is created by SaveAs?

Ed

--

Dave Peterson


--

Dave Peterson



 
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
Disable SelectionChange Event BillCPA Excel Discussion (Misc queries) 2 February 17th 06 06:45 PM
Disable or remove macros for a workbook to be sent in email... [email protected] Excel Programming 3 January 13th 05 03:31 PM
Convert XL2K wkbk w/ macros to XL97? Ed[_9_] Excel Programming 1 February 13th 04 08:46 PM
Suppress the Disable Macros / Enable Macros Dialog Shoji Karai Excel Programming 5 September 24th 03 03:10 AM
Disable Worksheet change event Tim[_14_] Excel Programming 4 July 15th 03 01:27 AM


All times are GMT +1. The time now is 08:33 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"