View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
mjones mjones is offline
external usenet poster
 
Posts: 86
Default Groups and Protected Worksheets - know if protected

Hi,

I've been using this Workbook code for a while and it works great to
allow protected sheets and outline to work together.

Private Sub Workbook_Open()
Dim mySheetNames As Variant
Dim iCtr As Long
mySheetNames = Array("Summary", "Concept", "Approval",
"Definition", "Planning", "Implementation", "Closeout")
For iCtr = LBound(mySheetNames) To UBound(mySheetNames)
With Worksheets(mySheetNames(iCtr))
.Protect Password:="hi", userinterfaceonly:=True
.EnableOutlining = True
'.EnableAutoFilter = True
'If .FilterMode Then
' .ShowAllData
'End If
End With
Next iCtr
End Sub

Today, I realized that it locks the worksheets every time I open the
spreadsheet.

Is there a way to recognize if the worksheets are protected or not and
leave them that way when the spreadsheet is opened?

This spreadsheet will be used by thousands of people so I'd really
appreciate help because it can't be used otherwise.

Thank you,

Michele