Prevent User from Changing Password

N

notso

I have a workbook that is password protected. I have a macro will hide and
unhide columns that users with the password can update. I have a button to
hide/unhide the columns on the sheet that is being displayed.

The problem is the user can unprotect the sheet from the tool bar and then
change the password. How do I prevent the user from doing this?

How can I force the user to reprotect the sheet with the pre-defined
password? Is there a VB event where I can check the new password with the
pre-defined password and force the user to enter the pre-defined password
only? I have password protected my VB code to prevent the users from seeing
the pre-defined password.
 
J

Jim Thomlinson

The problem is that the users have the password. Change the password and
don't let them know what it is... All of you macros can use that password to
protect and unprotect as necessary. If there is legitimate need for a user to
be able to change things then use the Tools -> Protection -> Allow users to
Edit feature (assuming XL2002 or better)...
 
N

notso

OK. I will do that. Now I will add a password to the macro to enable certain
users to unhide the columns - without unprotecting the sheets. Thanks!

Do you have existing code handy for a macro to ask for a password? If not, I
can come up with it. This way I can give them the macro password, but not the
worksheets password. THANK YOU!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top