Please could you help me understand and solve this problem:
I have a workbook with multiple worksheets that the user should not
see and change. I tested many methods independently to protect them:
1. I protected the worksheets with VBA in chosing for visible
xlsheetveryhidden from the properties sheet.
2. I put the codes in the worksheet
Private Sub HideSheet()
Sheet1.Visible = xlSheetVeryHidden
End Sub
I also used these codes when I open the workbook.
Sub Protect_all()
Dim WS As Worksheet
For Each WS In Worksheets
WS.Protect
Next WS
End Sub
3.I did from Tools protection, protect sheet.
I always get this error when I run the macros
Run Time error "1004"
Do you think I could use UserInterfaceOnly:=True, but I am not sure
how to use it.