Billdub417
New Member
- Joined
- Nov 5, 2019
- Messages
- 45
Hello,
Hopefully, someone can help, it seems trivial but I can't see what's going wrong. Thanks in advance!
I have an excel document with the coding as follows (to password protect each sheet on opening and then finish back on the Home page at the end):
This works fine on my local PC, however, when I sent this spreadsheet to someone and they enabled editing, they are receiving an error message - Run-time error '1004': Activate method of Worksheet class failed.
This is then pointing to the "Worksheets("Home").Activate" line
Any ideas why this would be?
Hopefully, someone can help, it seems trivial but I can't see what's going wrong. Thanks in advance!
I have an excel document with the coding as follows (to password protect each sheet on opening and then finish back on the Home page at the end):
VBA Code:
Private Sub Workbook_Open()
Application.ScreenUpdating = False
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Protect Password:="abc123", AllowFiltering:=True, UserInterfaceOnly:=True
Next ws
Worksheets("Home").Activate
Application.ScreenUpdating = True
End Sub
This works fine on my local PC, however, when I sent this spreadsheet to someone and they enabled editing, they are receiving an error message - Run-time error '1004': Activate method of Worksheet class failed.
This is then pointing to the "Worksheets("Home").Activate" line
Any ideas why this would be?