+ Reply to Thread
Results 1 to 7 of 7

Disable selected Excel Menu Commands

  1. #1
    Registered User
    Join Date
    10-16-2009
    Location
    South Africa
    MS-Off Ver
    Office 365
    Posts
    59

    Disable selected Excel Menu Commands

    Is it possible to use VBA to disable selected Excel menu commands? Enabling the commands should be password-protected. It will have to be functional in both Excel 2003 and 2007.

    Your effort and assistance will be appreciated!

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Disable selected Excel Menu Commands

    I would strongly recommend that you do not do this. If anything goes wrong & the menus are not restored you will have annoy users.

    Excel 2007 does not have menus, so the code would not work. You would need to hide the Ribbon

    Much simpler to just use Full Screen
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    10-16-2009
    Location
    South Africa
    MS-Off Ver
    Office 365
    Posts
    59

    Re: Disable selected Excel Menu Commands

    Maybe I should rephrase: I have often seen that certain menu/ribbon commands are grayed out. How do you go about doing this? (To me it as good as disabling a command, but I guess that is semantics)

  4. #4
    Registered User
    Join Date
    07-06-2009
    Location
    NH, USA
    MS-Off Ver
    2010 & 2013
    Posts
    38

    Re: Disable selected Excel Menu Commands

    Quote Originally Posted by antonf View Post
    Maybe I should rephrase: I have often seen that certain menu/ribbon commands are grayed out. How do you go about doing this? (To me it as good as disabling a command, but I guess that is semantics)
    A large number of commands are greyed out when a worksheet is properly locked and protected.

  5. #5
    Registered User
    Join Date
    02-18-2006
    Location
    Vancouver, WA - USA
    MS-Off Ver
    All components of Office 2007
    Posts
    31

    Re: Disable selected Excel Menu Commands

    Quote Originally Posted by antonf View Post
    Maybe I should rephrase: I have often seen that certain menu/ribbon commands are grayed out. How do you go about doing this? (To me it as good as disabling a command, but I guess that is semantics)
    You can disable many menu items pertaining to a sheet or workbook itself. If you just want to protect a sheet, in 2007, go down to the sheet tab and right click. Then select Protect Sheet. Then you check the boxes of the functions you want to allow users to have access to. You can also password protect each sheet. This comes in handy when you want different uses for each sheet.

    Hope that helps.
    __________________

    Best Regards,
    Jim
    Analyst

    Analyzing life, one day at a time!

    Forum Rules

    Click on the scales in the upper right corner of my post if you like what I suggested. It helps with my reputation. Thanks.

    My hidden rantings page - click here

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Disable selected Excel Menu Commands

    Have you read my comments?

    Have yo got the required skills to make good any problems created by your code messing up another user's settings?

    As I said the code will not work for 2007 & earlier versions, they would need to be different.

    If you remove these commands then your code also needs to restore them.

    Why do you want to do this?

  7. #7
    Registered User
    Join Date
    10-16-2009
    Location
    South Africa
    MS-Off Ver
    Office 365
    Posts
    59

    Re: Disable selected Excel Menu Commands

    Quote Originally Posted by royUK View Post
    Have you read my comments?

    Have yo got the required skills to make good any problems created by your code messing up another user's settings?
    yes, I have read the comments, but thought I didn't express myself very well. (English is my third language!) hence my follow-up post. NO, I definitely don't have the skills to repair the settings I mess up, not even on my own computer! Yes, I know all about fools who rush in where angels fear to tread!
    As I said the code will not work for 2007 & earlier versions, they would need to be different.
    If you remove these commands then your code also needs to restore them.

    Why do you want to do this?
    Before I get an infraction again, this is to some extent linked to another post I made

    I have a macro that adds comments whenever a change is made in the sheet. I would prefer the comments to stay hidden. The sheets are fairly simple and will generally not require other comments to be added. This way I can keep track of who changed what and when it was done.

    In short thus (for this specific case): I would like comments to be hidden, and a password is required to view/delete them.

    I will rather address the other similar situations in separate posts.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1