Results 1 to 10 of 11

Thread: Minimize/Maximize Ribbon using VBA

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Junior Member
    Join Date
    Apr 2013
    Posts
    1
    Rep Power
    0

    missing from sample code.... "DisplayRibbon" does not change anything

    missing from sample code....

    "DisplayRibbon" does not change anything


    there are five parameters provided to set values:
    Code:
    ShowRowColHeads As Boolean,
        ShowSheetTab As Boolean, _
        ShowGridLines As Boolean, _
        DisplayFBar As Boolean, _
        DisplayRibbon As Boolean
    
    
    only four are utilized
            ActiveWindow.DisplayHeadings = ShowRowColHeads
            ActiveWindow.DisplayWorkbookTabs = ShowSheetTab
            ActiveWindow.DisplayGridlines = ShowGridLines
            Application.DisplayFormulaBar = DisplayFBar
    please advise of corrected code sample

    FYI: thread rating of "BAD" due to incomplete sample code... and worst of all misses the question of how to manipulate "ribbon"




    https://www.youtube.com/channel/UCnxwq2aGJRbjOo_MO54oaHA
    Last edited by DocAElstein; 06-11-2023 at 01:15 PM.

  2. #2
    Administrator Excel Fox's Avatar
    Join Date
    Mar 2011
    Posts
    1,401
    Rep Power
    10
    It is easily understood from my post above that you should REPLACE one line with another.

    Code:
    Sub ToggleProperties(ByVal ShowRowColHeads As Boolean, _
                                        ByVal ShowSheetTab As Boolean, _
                                        ByVal ShowGridLines As Boolean, _
                                        ByVal DisplayFBar As Boolean, _
                                        ByVal DisplayRibbon As Boolean, _
                                        ParamArray ShtNames() As Variant)
                                        
        If Not IsMissing(ShtNames) Then
            ThisWorkbook.Worksheets(ShtNames).Select
            ActiveWindow.DisplayHeadings = ShowRowColHeads
            ActiveWindow.DisplayWorkbookTabs = ShowSheetTab
            ActiveWindow.DisplayGridlines = ShowGridLines
            Application.DisplayFormulaBar = DisplayFBar
            Application.ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon""," & DisplayRibbon & ")"
            ThisWorkbook.Worksheets(ShtNames(0)).Select
        End If
        
    End Sub
    A dream is not something you see when you are asleep, but something you strive for when you are awake.

    It's usually a bad idea to say that something can't be done.

    The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve

    Join us at Facebook

  3. #3
    Junior Member
    Join Date
    Jun 2012
    Posts
    4
    Rep Power
    0
    I think to hide ribbon. Best to switch the workbook in full view mode.
    I hope it is tricky..

Similar Threads

  1. Hide Ribbon, Gridlines, Heading and FormulaBar using VBA
    By LalitPandey87 in forum Excel Help
    Replies: 7
    Last Post: 06-10-2013, 04:41 PM
  2. Populate Ribbon Controls On Load Dynamically Through VBA Variables
    By phxpoolplayer in forum Excel Ribbon and Add-Ins
    Replies: 1
    Last Post: 04-20-2013, 01:51 AM
  3. Minimize and Maximize option in Excel UserForm
    By shabbirtaibany in forum Excel Help
    Replies: 1
    Last Post: 09-23-2012, 07:05 PM
  4. How To Add A New Group In A Ribbon
    By Excel Fox in forum Excel Ribbon and Add-Ins
    Replies: 2
    Last Post: 09-16-2011, 07:57 AM
  5. Add ribbon programmatically to Excel 2010 using VBA
    By heapifyman in forum Excel Ribbon and Add-Ins
    Replies: 6
    Last Post: 07-18-2011, 09:16 PM

Tags for this Thread

Posting Permissions

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