I have a user that has a spreadsheet she wants people to be able to filter on and also have some (not all) the cells protected.
I found a some good advice on using a Macro on the Workbook open event to accomplish this:
Private Sub Workbook_Open()
With ActiveWorkbook.Sheets("Sheet1"
.EnableAutoFilter = True
.Protect contents:=True, userInterfaceOnly:=True
End With
End Sub
However she now wants the sheet "Shared". And when the sharing is enabled and the worksheet is opened we get the following error:
Run time error '1004':
Protect method of Worksheet class failed.
Any ideas?
I found a some good advice on using a Macro on the Workbook open event to accomplish this:
Private Sub Workbook_Open()
With ActiveWorkbook.Sheets("Sheet1"

.EnableAutoFilter = True
.Protect contents:=True, userInterfaceOnly:=True
End With
End Sub
However she now wants the sheet "Shared". And when the sharing is enabled and the worksheet is opened we get the following error:
Run time error '1004':
Protect method of Worksheet class failed.
Any ideas?