+ Reply to Thread
Results 1 to 2 of 2

Commandbars

  1. #1
    PosseJohn
    Guest

    Commandbars

    I have a WB that creates both a menu and toolbar.

    (1) I want to hide all other menus, shortcut menus, and toolbars when the
    WB is active.

    (2) I want to restore those menus and toolbars that were visible before
    opening the WB upon either closing my WB or when a differant WB is selected.

    Can you give me reference to accomplish this? Thanx.

  2. #2
    Bob Phillips
    Guest

    Re: Commandbars

    Option Explicit


    Private mFormulaBar


    Private Sub Workbook_Activate()
    Dim oCB As CommandBar


    'Remove commandbars
    For Each oCB In Application.CommandBars
    oCB.Enabled = False
    Next


    'RemoveFormulaBar
    mFormulaBar = Application.DisplayFormulaBar
    Application.DisplayFormulaBar = False
    End Sub


    Private Sub Workbook_Deactivate()
    Dim oCB As CommandBar


    'Restore commandbars
    For Each oCB In Application.CommandBars
    oCB.Enabled = True
    Next


    'RestoreFormulaBar
    Application.DisplayFormulaBar = mFormulaBar
    End Sub


    'This is workbook event code.
    'To input this code, right click on the Excel icon on the worksheet
    '(or next to the File menu if you maximise your workbooks),
    'select View Code from the menu, and paste the code


    --



    --
    HTH

    Bob Phillips

    (remove nothere from email address if mailing direct)

    "PosseJohn" <[email protected]> wrote in message
    news:[email protected]...
    > I have a WB that creates both a menu and toolbar.
    >
    > (1) I want to hide all other menus, shortcut menus, and toolbars when the
    > WB is active.
    >
    > (2) I want to restore those menus and toolbars that were visible before
    > opening the WB upon either closing my WB or when a differant WB is

    selected.
    >
    > Can you give me reference to accomplish this? Thanx.




+ 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