View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Robert Crandal[_2_] Robert Crandal[_2_] is offline
external usenet poster
 
Posts: 158
Default password protection

The code for pasword protecting a sheet would look
something like this:

Sheet1.Protect "123"

As for the ribbon, I'm afraid I don't know how to disable
that.

Good luck!


"danial mansoor" wrote in message
...
wat is the vba code to protect sheet,wat i want if i pressed command
button sheet should be protected and set the password 123?

i also wanted to know is there a way to disable the ribbon using
macro?


can anyone one help me?