View Single Post
  #7   Report Post  
Harald Staff
 
Posts: n/a
Default

Hi

Have your macro unprotect the workbook.

Sub Demo()
ThisWorkbook.Unprotect ("Harald")
ThisWorkbook.Sheets(1).Visible = _
Not ThisWorkbook.Sheets(1).Visible
ThisWorkbook.Protect ("Harald")
End Sub

You can of course hijack the menu instead, but then you should code it to be
disabled for this file only and leave Excel untouched for other files. Note
also that sheets can be hidden/shown also from the VB editor and by code if
the workbook is unprotected.

HTH. Best wishes Harald

"ditchy" skrev i melding
oups.com...
Hi there Harald
when I (Tools Protection menu)protect workbook, I can't run the my
unhide macro I keep getting error 400.
I need a way to keep the format sheet/unhide in-operable until a
password is entered for my macro to show sheets.
regards, Ditchy
Harald Staff wrote:
Hi Ditchy

Protect the workbook (Tools Protection menu) to prevent hiding,

unhiding
and renaming of sheets.

HTH. Best wishes Harald

"ditchy" skrev i melding
oups.com...
Hello
is there a way to dis-able the unhide sheets toolbar?
TIA, Ditchy