Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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
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 to change tooltips for user-modified colors? Andy Smith[_2_] Excel Discussion (Misc queries) 1 September 15th 09 12:30 AM
Alert user that row has been modified by changing row color jubu Excel Worksheet Functions 2 June 30th 07 12:46 AM
Log User Name and Date when userform was run/modified Corey Excel Programming 1 November 21st 06 04:17 AM
Save user-defined chart types in a shared Excel template? graphicslady Charts and Charting in Excel 7 September 7th 06 02:07 PM
Saving changes to an modified color template Neil Excel Discussion (Misc queries) 1 April 26th 06 10:10 AM


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