I'm working on an Excel Workbook that uses VBA for data input, since I don't want the application itself to be available to the user if the user does not know the password.
I managed to set up the Userform for data input and then a new Userform for the password input.
However, I noticed that the password is easily bypassed if the Password Userform is terminated.
I tried to make the Userform_Terminate() take the user back to the previous Userform, but it just creates an endless loop.
Anyone know a workaround for this?
Private Sub UserForm_Terminate()
Unload Me
UserForm1.Show
End Sub
If what you need is disallowing user closing UserForm, then here is a solution.
Disable leaving form with either close button click or Alt+F4:
Code within UserForm:
Make close button on form unclickable and grayed out:
Code within UserForm:
Code within a module, works for 32 and 64 bit: