ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Disable Save and Save As (https://www.excelbanter.com/excel-programming/318344-disable-save-save.html)

Rob

Disable Save and Save As
 
Excel 2000

How can I disable the save and Save As options both icons and menu?

When I make changes however to the file, I will want to save albeit happy to
do so from the VBA menu.

Thanks, Rob



Ron de Bruin

Disable Save and Save As
 
Hi Rob

You can use this in the Thisworkbook module

Private Sub Workbook_BeforeClose(Cancel As Boolean)
ThisWorkbook.Saved = True
End Sub

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, _
Cancel As Boolean)
Cancel = True
End Sub

Remember that this will not work if the user disable macro's

And then use a save macro like this

Sub test()
Application.EnableEvents = False
ThisWorkbook.Save
Application.EnableEvents = True
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Rob" wrote in message ...
Excel 2000

How can I disable the save and Save As options both icons and menu?

When I make changes however to the file, I will want to save albeit happy to do so from the VBA menu.

Thanks, Rob




PosseJohn

Disable Save and Save As
 
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)

Cancel = True

End Sub

Rob

Disable Save and Save As
 
Thanks very much, works a treat. Rob
"PosseJohn" wrote in message
...
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)

Cancel = True

End Sub





All times are GMT +1. The time now is 12:00 AM.

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