Ten kod umożliwia zapisanie skoroszytu tylko jako samego.
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If SaveAsUI Then
Cancel = True
MsgBox "Sorry, you can only save this workbook with its original name."
End If
End Sub
Ten kod pozwoli na niezapisanie przez wszystkich oprócz tych, którzy wiedzą jak (application.enableevents).
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Cancel = True
MsgBox ("All File Save and File Save As commands in this sheet ONLY have been turned OFF. Pretty cool, huh??")
End Sub