R
Roxana
Hello,
I have an Excell workbook sent from another party which contains macros and
vba code.
I have to use it with other co-workers and I was trying to share the
document with the rest of the team.
Unfortunately after we set the sharing option, we get this error : Run-time
Error 1004, Method 'Unprotect' of object '_Workshhet' failed.
I looked in the code and found this reference to protect/unprotect method:
Public Sub lockSheet()
Dim activeSheet As Worksheet
Set activeSheet = Application.ActiveWorkbook.activeSheet
activeSheet.Unprotect (modMain.WsPw)
activeSheet.EnableOutlining = True
'activeSheet.Protect Scenarios:=True, UserInterfaceOnly:=True
activeSheet.Protect _
Password:=modMain.WsPw, _
userinterfaceonly:=True, _
AllowFormattingCells:=True, _
AllowFormattingColumns:=True, _
AllowFormattingRows:=True, _
AllowFiltering:=True
End Sub
Can anyone help?
Thanks
Roxana
I have an Excell workbook sent from another party which contains macros and
vba code.
I have to use it with other co-workers and I was trying to share the
document with the rest of the team.
Unfortunately after we set the sharing option, we get this error : Run-time
Error 1004, Method 'Unprotect' of object '_Workshhet' failed.
I looked in the code and found this reference to protect/unprotect method:
Public Sub lockSheet()
Dim activeSheet As Worksheet
Set activeSheet = Application.ActiveWorkbook.activeSheet
activeSheet.Unprotect (modMain.WsPw)
activeSheet.EnableOutlining = True
'activeSheet.Protect Scenarios:=True, UserInterfaceOnly:=True
activeSheet.Protect _
Password:=modMain.WsPw, _
userinterfaceonly:=True, _
AllowFormattingCells:=True, _
AllowFormattingColumns:=True, _
AllowFormattingRows:=True, _
AllowFiltering:=True
End Sub
Can anyone help?
Thanks
Roxana