, , - VBA UserInterFaceOnly: = True. . VBA , , workbook_open. , vba .
For Each wsheet In ActiveWorkbook.Worksheets
Select Case wsheet.Name
Case "Some Specific Sheet Name 1", "Another Specific Sheet name"
wsheet.Protect Password:=pw, DrawingObjects:=True, Contents:=True, Scenarios:=True, _
AllowFiltering:=True, UserInterFaceOnly:=True
wsheet.EnableSelection = xlNoRestrictions
Case "Some Sheet I want to hide"
wsheet.Protect Password:=pw, DrawingObjects:=True, Contents:=True, Scenarios:=True, _
AllowFiltering:=True, UserInterFaceOnly:=True
wsheet.EnableSelection = xlNoRestrictions
wsheet.visible = False
Case "LookupsSome Sheet I want to hide, but not protect"
wsheet.visible = False
Case "Some sheet I really really want to hide"
wsheet.visible = xlVeryHidden
Case "Some sheet I dont want to do anything with"
'Dont do anything
Case Else 'Every other sheet is hidden and protected
wsheet.visible = False
wsheet.Protect Password:=pw, DrawingObjects:=True, Contents:=True, Scenarios:=True, _
AllowFiltering:=True, UserInterFaceOnly:=True
wsheet.EnableSelection = xlNoRestrictions
End Select
Next wsheet