Consulting

Results 1 to 4 of 4

Thread: Hiding ribbon commands

  1. #1
    VBAX Contributor
    Joined
    Jul 2017
    Location
    Zurich
    Posts
    132
    Location

    Hiding ribbon commands

    Hi Folks

    Trying to hide the commands from tabs. So far I've found a way to hide:

    Application.ExecuteExcel4Macro "Show.Toolbar(""Ribbon"",false)"

    However, that hides the all of it. I'd like to have only the tab names (ie. Start, Insert, PageLayout,...) as if choosing the option in the picture below.

    tabs2.jpg
    Attached Images Attached Images

  2. #2
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  3. #3
    VBAX Contributor
    Joined
    Jul 2017
    Location
    Zurich
    Posts
    132
    Location
    This seems to do the trick:

    CommandBars.ExecuteMso "MinimizeRibbon"

  4. #4
    VBAX Contributor
    Joined
    Jul 2017
    Location
    Zurich
    Posts
    132
    Location
    ...However it's a trigger Statement, ie. alternating minimizing and maximizing the ribbon. Therefore I introduced 2 variables to track the current state via the ribbon height:

    numHöheMenübandAus = CommandBars("Ribbon").Height


    CommandBars.ExecuteMso "MinimizeRibbon"


    numHöheMenübandEin = CommandBars("Ribbon").Height


    If Not numHöheMenübandAus < numHöheMenübandEin Then
    CommandBars.ExecuteMso "MinimizeRibbon"
    End If

    This works fine when walking through in debug mode, however, when calling the procedure at once via picutures with assigned macros, it does hide the ribbon, but not unhide it.

    If anyone likes to have a look into my file, the pw = plan; and if so, any comments or tips to improve are very welcome


    cheers and regards
    Attached Files Attached Files

Posting Permissions

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