Nothing goes in the ()'s for this procedure:
Private Sub Workbook_Open()
With Worksheets("Sheet1")
.EnableOutlining = True
.Protect Password:="password", _
Contents:=True, UserInterfaceOnly:=True
End With
End Sub
But it only protects a worksheet named Sheet1. If you have multiple sheets,
then every other sheet wasn't affected.
If you can list the worksheet names:
Private Sub Workbook_Open()
Dim mySheetNames As Variant
Dim iCtr As Long
'change to match your workbook
mySheetNames = Array("sheet1", "sheet2", "sheet3")
For iCtr = LBound(mySheetNames) To UBound(mySheetNames)
With Worksheets(mySheetNames(iCtr))
.Select
.EnableOutlining = True
.Protect Password:="password", _
Contents:=True, UserInterfaceOnly:=True
End With
Next iCtr
End Sub
This will open the workbook with Sheet3 selected. Put the worksheet name that
you want to see selected when it's done as the last name.