Results 1 to 2 of 2

Thread: RibbonX Custom Tab to show up upon opening

  1. #1
    Junior Member
    Join Date
    Dec 2014
    Posts
    4
    Rep Power
    0

    RibbonX Custom Tab to show up upon opening

    I have created a ribbon from scratch and all is fine. Only two tabs and each called depending on a active worksheet. My only problem is ribbon does not show up when doc opens. No errors. I have to click on another sheet and ribbon loads. Is there any way I can correct this and have ribbon loaded immediately when doc openes? Below is code I have used to load the custom UI

    Code:
    Private Sub Workbook_SheetActivate(ByVal sh As Object)
        Select Case sh.CodeName
        Case "Sheet2": Call RefreshRibbon(Tag:="Cover")
        Case Else: Call RefreshRibbon(Tag:="Schedule")
        End Select
    
    End Sub
    Last edited by dkesar; 12-28-2014 at 03:40 AM.

  2. #2
    Junior Member
    Join Date
    Dec 2014
    Posts
    4
    Rep Power
    0

    Add to above

    ..and I have forgot to mention below code is present in RibbonModule in order to load ribbon

    Code:
    Option Explicit
    
    Dim Rib As IRibbonUI
    Dim MyTag As String
    
    Sub RibbonOnLoad(ribbon As IRibbonUI)
        Set Rib = ribbon
    End Sub
    
    Sub GetVisible(control As IRibbonControl, ByRef visible)
        If MyTag = "show" Then
            visible = True
        Else
            If control.Tag Like MyTag Then
                visible = True
            Else
                visible = False
            End If
        End If
    End Sub
    
    Sub RefreshRibbon(Tag As String)
        MyTag = Tag
        If Rib Is Nothing Then
            MsgBox "Error, restart your workbook"
        Else
            Rib.Invalidate
        End If
    End Sub

Similar Threads

  1. Office RibbonX - Large SubMenu Items Within A Dynamic Menu
    By mahat in forum Excel Ribbon and Add-Ins
    Replies: 5
    Last Post: 12-19-2014, 09:21 AM
  2. Rename tab on cell value from another worksheet
    By jeremiah_j2k in forum Excel Help
    Replies: 6
    Last Post: 12-02-2014, 02:50 PM
  3. Worksheet Tab Name Based on Cell Value
    By tuna666 in forum Excel Help
    Replies: 2
    Last Post: 10-08-2013, 10:41 PM
  4. Opening URL @ new tab in Internet Explorer: VBA
    By Transformer in forum Tips, Tricks & Downloads (No Questions)
    Replies: 0
    Last Post: 09-11-2013, 08:22 PM
  5. How to Add Custom List And Use in Custom Sorting
    By Transformer in forum Tips, Tricks & Downloads (No Questions)
    Replies: 0
    Last Post: 06-07-2013, 10:41 PM

Posting Permissions

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