ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro to prevent saving (https://www.excelbanter.com/excel-programming/292422-macro-prevent-saving.html)

stols121

Macro to prevent saving
 
Does any one know a macro for preventing the user to save

--
Message posted from http://www.ExcelForum.com


Bernie Deitrick

Macro to prevent saving
 
A really determined user? No, can't be done. A casual user? In the
Workbook's BeforeSave event, put in the line

Cancel = True

and that will cancel the save.

HTH,
Bernie
MS Excel MVP

"stols121 " wrote in message
...
Does any one know a macro for preventing the user to save?


---
Message posted from http://www.ExcelForum.com/




Frank Kabel

Macro to prevent saving
 
Hi
one way: Put the following code in your workbook module:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
MsgBox "Saving not allowed"
Cancel = True
End Sub

--
Regards
Frank Kabel
Frankfurt, Germany

Does any one know a macro for preventing the user to save?


---
Message posted from http://www.ExcelForum.com/




All times are GMT +1. The time now is 06:55 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com