Colin Hayes explained :
Hi Garry
OK Thanks for that. I'm grateful for your help.
It's working fine , but puts up a popup for each sheet in the workbook when
protecting. This means a key press for each worksheet. Ideally it would
protect all of them one after another on the first single response. Is this
possible?
Also , it seems to put up the 'protect ' popup on the 'unprotect' cycle ,
when of course it's not necessary.
Yes , it's commented out in the same way as you suggested earlier because
it's related to preserving the permissions in the calendar program which are
not required for other workbooks I have.
Colin,
I don't see how the 'popup' can display before the Else part, meaning
the sheet is unprotected and therefore needs to be protected.
Also, I don't understand why your protect/unprotect procedure would
deliberately iterate the sheets. I do that before calling my procedure
so I have the flexibility I need to be able to do single sheets, and/or
specify the workbook. Please review my code sample[s] for using
wksProtect. I recommend going with the 'Wks As Worksheet' version.
Also, I didn't include unprotect code deliberately because that's
always a one-liner: 'wks.Unprotect PWORD'. Works whether a PWORD
exists or not (ergo, no error is raised if no password is used).
Finally, I don't give users the option to choose permissions for sheets
that belong to a project. Might be okay to do if a general utility,
though!
--
Garry
Free usenet access at
http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc