+ Reply to Thread
Results 1 to 3 of 3

disable menues

Hybrid View

amsanborn disable menues 05-27-2009, 01:08 AM
antoka05 Re: disable menues 05-27-2009, 02:36 AM
royUK Re: disable menues 05-27-2009, 03:20 AM
  1. #1
    Registered User
    Join Date
    12-19-2008
    Location
    Vancouver,WA
    MS-Off Ver
    2007 Excel
    Posts
    87

    Smile disable menues

    is there a code to disable all menues?

  2. #2
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628

    Re: disable menues

    Try with this code:
    Sub DisableMenui()
       On Error Resume Next
       For Each cmdBar In Application.CommandBars
          For Each ctl In cmdBar.Controls
             ctl.Enabled = False
             
             For Each ctl1 In ctl.Controls
                ctl1.Enabled = False
             Next
          Next
       Next
    End Sub
    Regards,
    Antonio

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

    Re: disable menues

    be extremely careful when using such code. You have to re-set all menus back to the user's settings. The posted code will disable the menus, but if you do not enable the ones that the user has visible afterwards then you will annoy you users!
    Hope that helps.

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

    Free DataBaseForm example

+ 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