B
Bhupinder Rayat
Hi all,
I am using the unprotect method in VBA (on a sheet
containing a password);
ActiveSheet.Unprotect
which brings up the password prompt box. If the correct
password is entered and 'OK' is pressed, the sheet is
unprotected and then I have some "further code" that
runs.
If a wrong password is entered, I have a error handler
that deals with it.
The trouble is that when the password prompt box appears,
and I press the 'cancel' button, the "further code" still
runs.
How can I get the code to exit the sub after the 'cancel
button is pressed, so nothing happens?
Any help will be much appreciated.
Thanks,
Bhupinder Rayat
I am using the unprotect method in VBA (on a sheet
containing a password);
ActiveSheet.Unprotect
which brings up the password prompt box. If the correct
password is entered and 'OK' is pressed, the sheet is
unprotected and then I have some "further code" that
runs.
If a wrong password is entered, I have a error handler
that deals with it.
The trouble is that when the password prompt box appears,
and I press the 'cancel' button, the "further code" still
runs.
How can I get the code to exit the sub after the 'cancel
button is pressed, so nothing happens?
Any help will be much appreciated.
Thanks,
Bhupinder Rayat