Hello all. I want to make a copy of my Excel application into a demo/evaluation version so I do not want the give the user an opportunity to save the workbook at all. I am currently using this code:
It seems to be working but I don't know too much about Cancel = True and the effects it has on other modules. Is this a good way to disable all saving methods? I know if a user enters "Design Mode" the workbook can be saved but the chances of that happening are slim to none, but still, an ounce of prevention prevails here.
Since my app opens and functions totally in Full Screen Mode it does not utilise any menus or ribbons so I thought of disabling all ribbons and menus and replacing it with a custom ribbon menu with one macro, when clicked, opens a message box stating that editing is not allowed (not sure how to do that... yet). This would surely prevent "Design Mode" from being selected.
I am using MS Office 365 Excel on Windows 10. The app is designed to be backward compatible and does not utilize any functions or coding specific to Excel365
VBA Code:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
MsgBox "This is an evaluation version. You can't Save, Save As... or Save a Copy As of this workbook!", 48, "Payroll Evaluation Version"
Cancel = True
End Sub
It seems to be working but I don't know too much about Cancel = True and the effects it has on other modules. Is this a good way to disable all saving methods? I know if a user enters "Design Mode" the workbook can be saved but the chances of that happening are slim to none, but still, an ounce of prevention prevails here.
Since my app opens and functions totally in Full Screen Mode it does not utilise any menus or ribbons so I thought of disabling all ribbons and menus and replacing it with a custom ribbon menu with one macro, when clicked, opens a message box stating that editing is not allowed (not sure how to do that... yet). This would surely prevent "Design Mode" from being selected.
I am using MS Office 365 Excel on Windows 10. The app is designed to be backward compatible and does not utilize any functions or coding specific to Excel365