Hello,
This thread is about sheet protection acting weird, Run-time error '1004' and worksheet_open
I have an annoying problem with protected sheets. I have two simple macros dealing with protection, sheets_lock() and sheets_unlock().
Basically they just do:
or
I also have a Boolean they toggle to monitor if sheets are protected or not, and there's a condition for both that the Boolean must be in the opposite state before running lock or unlock
Now each time I open the workbook, I made it automatically Call sheets_lock()
I get an error 1004, saying I can't change a lock-toggle-buttons name because sheets are locked. sheets_lock() shouldn't start at all if sheets are locked.
It gets more interesting. I added messages to debug this problem. I made a debug message to tel me if activeworkbook.sheets("*").Protectcontents = true or false
It always tells me it's not protected. I also made a message about whether the variable monitoring protection is TRUE or FALSE. Always says false.
And the next thing is, the button text cant be changed because it's a protected sheet
I can provide any additional information or code if needed. Thanks
Sub sheets_lock:
Bookmarks