If unprotecting the worksheet in that step works, then changing the protection
mode (to userinterfaceonly:=true) isn't working.
My guess is that you have some kind of code that hides the error (but I've been
wrong lots of times).
dim wks as worksheet
on error resume next
for each wks in activeworkbook.worksheets
wks.protect password:="blahh", userinterface:=true
next wks
on error goto 0
But that's just a guess.
If you want to try to resolve that problem, you may want to post the code that
changes that protection--and share when it's called.
OrientalPearl wrote:
Sorry. The original code does use both UserInterfaceOnly and Password.
Password is required at all times during any interaction with both
certain locked cells and macro behind. Only one password is used in all
cases.
To be honest, I dont know what caused the problem(but adding the extra
'ActiveSheet.Unprotect Password:="blah"' just before the crashing point
does help and solve it) since even when the whole workbook is protected
by calling a dedicated method(it loops through all worksheets and lock
them up one by one setting UserInterfaceOnly True and Password), the
macro should still be able to work on it simply because
UserInterfaceOnly is True.
Many thanks for all your posts! May I also point you to my another
riddle on the following
link?http://groups.google.co.nz/group/mic...55f5981fcb06fe
Regards
Frank
--
Dave Peterson