disable save and print button

  • Thread starter Thread starter Gary C. Infinger
  • Start date Start date
You can copy/paste this into the ThisWorkBook code module :-

'---------------------------------------------------------
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Cancel = True
MsgBox ("Printing not allowed.")
End Sub

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Cancel = True
MsgBox ("Saving not allowed.")
End Sub
'----------------------------------------------------------
 
If you actually want to 'Disable' the save and print buttons to try an
discourage your user to press them you can do the following:

Application.CommandBars("Standard").Controls("Save").Enabled = False
Application.CommandBars("Standard").Controls("Print (EPSON Stylu
Photo 915)").Enabled = False

It took a while to realise that I needed to put the full name of th
print button in and not just ("Print"). You can find this name in cod
by returning the caption property
 
Back
Top