If you go to Tools>Protection>ProtectSheet> and then Enter a password and DESELECT all options, then you get a nice read only sheet that allows other users to see what you've done, but they can't copy and paste it.
PROBLEM - How do you replicate that programatically in VBA? I'm trying to do something like:
Public Sub Workbook_BeforeClose(Cancel As Boolean)
If "the sheet is already protected" then
"Just exit the workbook."
Else
"Protect the sheet as described above."
End If
End Sub
I got it to turn on the protection with a password, but no matter what I do, I can't replicate with code the deselection of those options - in other words, it allows the user to hilite and copy/cut ranges.
There has to be a way to do this with code. Help!
PROBLEM - How do you replicate that programatically in VBA? I'm trying to do something like:
Public Sub Workbook_BeforeClose(Cancel As Boolean)
If "the sheet is already protected" then
"Just exit the workbook."
Else
"Protect the sheet as described above."
End If
End Sub
I got it to turn on the protection with a password, but no matter what I do, I can't replicate with code the deselection of those options - in other words, it allows the user to hilite and copy/cut ranges.
There has to be a way to do this with code. Help!