Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Do not let user save template if it has been been modified
Hi all,
I have a template that I do not want it to be saved under any circumstances when any part of it is modified. I have been able to program the X button not to save with: Private Sub Workbook_BeforeClose(Cancel As Boolean) Saved = True End Sub but not sure what coding is needed so it will not save if the user click the save button or chooses the file|save or file|save as option from the menu item. Thanks in advance. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Do not let user save template if it has been been modified
Maybe you could just use the workbook_beforeSave event:
Option Explicit Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) Cancel = True End Sub Remember that if macros are disabled--or events disabled--then this won't help. And you'll want to find a way to save your file when you make updates--maybe use a macro that turns off events, does the save, and reenables events. Option Explicit sub SaveMeNow() application.enableevents = false activeworkbook.save application.enableevents = true end sub == and any user could do the same kind of thing, too. Maddoktor wrote: Hi all, I have a template that I do not want it to be saved under any circumstances when any part of it is modified. I have been able to program the X button not to save with: Private Sub Workbook_BeforeClose(Cancel As Boolean) Saved = True End Sub but not sure what coding is needed so it will not save if the user click the save button or chooses the file|save or file|save as option from the menu item. Thanks in advance. -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to change tooltips for user-modified colors? | Excel Discussion (Misc queries) | |||
Alert user that row has been modified by changing row color | Excel Worksheet Functions | |||
Log User Name and Date when userform was run/modified | Excel Programming | |||
Save user-defined chart types in a shared Excel template? | Charts and Charting in Excel | |||
Saving changes to an modified color template | Excel Discussion (Misc queries) |