Hi all,
I have a workbook with 10 sheets (6 visible, 4 hidden). Currently, I am setting the workbook password and the sheet protection password with the following code:
Public Const PW As String = “abcdefg”
While this is efficient while there are few users, I worry that over time someone will figure out the code or use software to crack the code. I would like the user to be able to change the current password, enter a new password, and confirm the new password (much like the Excel 2000 password dialog).
I seem to be getting hung up with the logic of storing and switching the new password with the old password within the variables in VBA. I am thinking my code will have to do the following:
1.Disable screenupdating and set enablecancelkey=xldisabled
2.Unprotect the workbook with the old password
3.Unprotect each sheet in the workbook with the old password
4.Protect each sheet in the workbook with the new password
5.Protect the workbook with the new password
With all the wisdom exhibited in this forum, surely someone here has done this before. Could anyone shed some light or code on this?
Thanks,