Sheet protection complications

  • Thread starter Thread starter Robert Crandal
  • Start date Start date
R

Robert Crandal

My workbook contains multiple sheets. After a set time
period, the workbook will automatically run code that
will password protect each and EVERY sheet in the workbook.

My question is, what happens if a user decides to password
protect a sheet with his/her own password before my code
automatically tries to do the script above?? It will try to
password protect a sheet that has already been password
protected by the user, therefore it will fail right?? If this is
true, can I prevent users from password protecting their sheets
with their own passwords???

thank u
 
Hi Robert,

Why don't you protect the sheets in the workbook open event, but set the
Userinterfaceonly property to true which will allow your code to run? You can
then used the cells' locked property to lock and unlock various cells or
ranges.

Alternatively if you have a Excel 2003 or earlier you could disable the
Protection items in the Tools menu.

Libby
 
Hello Libby.... thanks for your help, as always!

I dont have much experience using the "Userinterfaceonly"
property. What happens when I set this to true? Is it
also an Application object property??
 
Hi Libby.... I actually have another question....

Do you know if there is an easy way to set ALL cells on any
given sheet to the "locked" property?? Or must I run
a loop that go's through all cells to set them all to "locked"???

thnx
 
Back
Top