If you wish to stop a user from saving a file, you can use below in the workbook code.
Note : Make sure you put some thoughtful conditions before the 'Cancel = True' , so only you or dedicated people are allowed to save the file.
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If Environ("username") <> "mm" Then Cancel = True
End Sub
Note : Make sure you put some thoughtful conditions before the 'Cancel = True' , so only you or dedicated people are allowed to save the file.
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If Environ("username") <> "mm" Then Cancel = True
End Sub
No comments:
Post a Comment