lundi 5 février 2018

VBA - Prevent users from saving unless checkbox is checked

I'm using this macro in order to prevent a user from saving the workbook unless they accept the Terms and Conditions, annotated with a checkbox.

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)

    MsgBox "Please accept the terms and conditions"
    Cancel = True

End Sub

But this macro prevents a user from saving indefinitely. How can I make it so the user has to check a checkbox in order to save?

Thanks!




Aucun commentaire:

Enregistrer un commentaire