Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problems with Protect Method
- Excell 2003, SP2 - I have a workbook that contains several sheets. Only the first one has been protected. Through VBA, I'm trying to protect all the sheets, so I do the following: Code: -------------------- Sub LockAll() Dim wSheet As Worksheet Worksheets(1).Unprotect Password:="passwd_string" For Each wSheet In Worksheets wSheet.Protect Password:="passwd_string" Next End Sub -------------------- Can anyone tell me why it successfully Unprotects and Re-Protects ONLY the first sheet and doesn't Protect any of the other ones? (Remember, the other sheets don't start out Protected, only the first one does.) -- AMK4 ------------------------------------------------------------------------ AMK4's Profile: http://www.excelforum.com/member.php...o&userid=19143 View this thread: http://www.excelforum.com/showthread...hreadid=501872 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
protect sheet macro problems | Excel Discussion (Misc queries) | |||
Problems with a method form multiple worksheets | Excel Programming | |||
Problems with Printout Method | Excel Programming | |||
Excel VBA - Problems using Protect/Unprotect a worksheet | Excel Programming | |||
Problems with Excel Web Query for Post Method URL | Excel Programming |