Password Macro


Posted by Garry on September 17, 2000 5:27 AM

I have a workbook with numerous sheets both displayed and hidden.
About 20 of use this workbook to record our results.
The workbook and all sheets are all password protected.
From time to time I have to make minor changes to all copies
which the guys Email to me

I'm having difficulty with a macro that will;
Open the workbook, remove my password on several of the worksheets,
Unhide the hidden worksheets that are protected with my password,
and then after hiding it protecting the individual sheets and workbook
with my password again.

With some 20 workbooks to modify its becoming time consuming.

I'm using Excel95.
Thanks

Garry

Posted by doughboy on September 19, 0100 12:36 AM

Re: Passwords and sorting with a Macro


You need to unprotect using the password such as

ActiveSheet.Unprotect Password:="PASSWORD"
ActiveSheet.protect Password:="PASSWORD"

try using the Password:="PASSWORD" after the commands




Posted by Rick Alford on September 18, 0100 3:19 PM

Passwords and sorting with a Macro


Garry I have a simular problem with a worksheet that requires sorting and printing that will not function properly when password protected. I just tried to record a macro to unprotect the sheet and protect it back but to no avail.

I'm sure your answer will be simular to mine.

Rick