View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Frank Kabel Frank Kabel is offline
external usenet poster
 
Posts: 3,885
Default Unprotect workbook

Hi
this is an option of the protect worksheets dialog. To get the syntax
for this you may record a macro while manually protecting a sheet

--
Regards
Frank Kabel
Frankfurt, Germany

"Jean-Paul De Winter" schrieb im Newsbeitrag
...
Hi
I the code of a pushbutton I wrote:

Private Sub CommandButton5_Click()
ActiveWorkbook.Unprotect
Dim thing As Worksheet
For Each thing In Worksheets
thing.Unprotect
Next thing
End Sub

This seems to work but, when protected I still can choose a cell (but

I can
not change anything... that's OK)
What to write so I can't even choose the cell??
Thanks
JP
"Frank Kabel" schreef in bericht
...
activeworkbook.protect
activeworkbook.unprotect

--
Regards
Frank Kabel
Frankfurt, Germany

"Jean-Paul De Winter" schrieb im

Newsbeitrag
...
Hi,
To unprotect a sheet with a click on a pushbutton I wrote:

Private Sub CommandButton5_Click()
Dim thing As Worksheet
For Each thing In Worksheets
thing.Unprotect
Next thing
End Sub

But what is the syntax to unprotect and protect a workbook?
Thanks