Forum Discussion
Anonymous
Aug 27, 2020Not applicable
Preventing document to be saved by other users?
I have created a daily "pass on" for supervisors to fill out per their request. This is a macro enabled document automated with buttons. The supervisors are not very tech savvy and continue to "file-...
mtarler
Aug 27, 2020Silver Contributor
You say this is a Macro-enabled workbook with buttons that run macros but the attachment is .xlsx which is not macro-enabled. TBH I didn't even bother opening the attachment. IF your actual document is macro enabled (.xlsm or .xlsb) then you can write a small event routine under the "ThisWorkbook" object:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
[enter some code to prevent save and/or warn before saving except if the save request is coming from your button]
End Sub