Try this.

Option Explicit
 
Public Sub ProtectAll()
Const PWORD As String = "mysecretword"
Dim wsSheet As Worksheet
For Each wsSheet In Worksheets
        wsSheet.Protect Password:=PWORD, DrawingObjects:=False, _
        Contents:=True, Scenarios:=True, AllowFiltering:=True, _
        AllowUsingPivotTables:=True, UserInterfaceOnly:=True
    Next wsSheet
End Sub

If that doesn't work can you post an attachment that shows the error?