LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
protect sheet macro problems Nikki Excel Discussion (Misc queries) 2 May 25th 07 04:55 AM
Problems with a method form multiple worksheets filo666 Excel Programming 1 July 14th 05 04:29 PM
Problems with Printout Method No Name Excel Programming 0 March 3rd 05 04:33 PM
Excel VBA - Problems using Protect/Unprotect a worksheet Gary Richie Excel Programming 2 February 6th 04 03:29 AM
Problems with Excel Web Query for Post Method URL Brian Excel Programming 0 July 24th 03 03:55 AM


All times are GMT +1. The time now is 06:05 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"