You need to unprotect the shared workbook first. The code below is a simplified stand alone version.
Sub Unprotect_Sheet()
ActiveWorkbook.UnprotectSharing "YourPassword”
End Sub
In your case you might like to try
Private Sub workbook_open()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Sheets
ws.Protect Password:="password", SharingPassword:= "SharedPassword", userinterfaceonly:=True, _
AllowFormattingCells:=True, _
AllowFormattingColumns:=True, _
DrawingObjects:=False, _
Contents:=True
ws.EnableOutlining = True
ws.EnableAutoFilter = True
Next End Sub