Ron,
Thanks, I've actually read you article and it's an excellent source of
information.
http://www.rondebruin.nl/menuid.htm
I was a bit lazy and did it this way for 2 reasons, Frstly, I could do it in
my head because names are intuative whereas numbers aren't. But more
importantly on your web page the menu numbers are given for Tools|Protection
but not for the next level down i.e. protect/unprotect. Where can I find
these?
Mike
"Ron de Bruin" wrote:
> Hi Mike
>
> Tip: Never use the name of the controls
> If your workbook is used in a non English version your code will blow up
>
> Use the ID of the control
> See
> http://www.rondebruin.nl/menuid.htm
>
>
> --
>
> Regards Ron de Bruin
> http://www.rondebruin.nl/tips.htm
>
>
> "Mike H" <(E-Mail Removed)> wrote in message news:62CA3E7C-AFF3-42D4-88DD-(E-Mail Removed)...
> > Seems a bit sledghammer/walnut to me but anyway, try this
> >
> > Sub Disableit()
> > With Application.CommandBars("Worksheet Menu Bar")
> > With .Controls("&Tools")
> > With .Controls("&Protection")
> > .Controls("Unprotect Sheet...").Enabled = False
> > End With
> > End With
> > End With
> > End Sub
> >
> > Mike
> >
> > "Mary Cullen" wrote:
> >
> >> In my VB code I want to disable the "unprotect sheet" command in
> >> tools/protection. I am trying to avoid password protecting the sheet
>