I think with a shared workbook, you can only modify data but you cannot modify any structure or object.
To prevent user uses the Excel built-in Save button or menu you can do it like this:
In ThisWorkbook code module:
In the code module of the sheet that contains the button [cmdSaveHFR] :Code:Option Explicit Public bAllowSave As Boolean Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) If bAllowSave = False Then MsgBox "Please Click button [Save HFR] to Save the workbook.", _ vbExclamation, "Cannot Save Now" Cancel = True End If End Sub
However, remember that those won't prevent users to disable/stop macros then save with Excel built-in Save function.Code:Option Explicit Private Sub cmdSaveHFR_Click() ThisWorkbook.bAllowSave = True '-- your extra code before saving here ThisWorkbook.Save ThisWorkbook.bAllowSave = False End Sub




Reply With Quote