Run time Error 1004, on shared workbook

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
 
R

Roxana

Thank you Shane,
I knew that shared workbooks have issues, and I wasn't trying to do anything
fancy...just trying to opne the workbook. It looks like whoever created the
workbook , wanted to protect some areas on each worksheet and let the user
enter info in the un-protected area...which menas that the workbook cannot be
shared.

thanks again
R
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top