Disable Save and Save As

  • Thread starter Thread starter Rob
  • Start date Start date
R

Rob

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
 
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
 
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)

Cancel = True

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top