Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have one sub routines that is called from several locations in my VBA code;
sometimes the worksheet is already unprotected when the sub routine is called and sometimes it is not. The problem is that my sub routine makes changes to the sheet and reprotects. When this is called on by code that already unprotected, then the sheet is protected after the routine is called and the next line that edits the sheet crashes. I cannot remove the protect statement from the sub routine, because it would occasionally cause the sheet to remian unprotected. Is there a way for the sub routine to check to see if the worksheet is protected so I can add an if statement to check this. if the worksheet is protected when the sub routine is called, then it will unprotect, make changes, and re-protect; if it is not protected, then it will leave the sheet unprotected. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to determine if the workbook is protected? | Excel Programming | |||
Edit text format in non-protected cells in protected worksheet | Excel Discussion (Misc queries) | |||
How to determine whether a protected sheet has a password? | Excel Programming | |||
Copying a worksheet witrh protected cells to a new worksheet | Excel Worksheet Functions | |||
Using Worksheet Codename to Determine Worksheet Existence | Excel Programming |