Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If you don't want to edit the VBA directly when you save it by removing the
uneeded modules, you could put an if statement in each event that checks the name of the workbook, if it is not the "master template" then do not run. ben "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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 can 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Disable SelectionChange Event | Excel Discussion (Misc queries) | |||
Disable or remove macros for a workbook to be sent in email... | Excel Programming | |||
Convert XL2K wkbk w/ macros to XL97? | Excel Programming | |||
Suppress the Disable Macros / Enable Macros Dialog | Excel Programming | |||
Disable Worksheet change event | Excel Programming |