Forum Discussion

666_666666's avatar
666_666666
Copper Contributor
May 27, 2023

VBA excel dropDown customUI trouble

 

 

SelectedIndex = None

InvalidateControl

 

 

this "code" deactivates the item in the dropdownlist
, but there is no redrawing (the list item is not active, but is displayed) #according to the manual, invalidate should initiate redrawing

if I switch to another tab with my hands and return to a custom tab,
the element is not displayed (this is the result I need)

please tell me how I can force excel 2016 to redraw the ribbon or switch to another tab

3 Replies

  • NikolinoDE's avatar
    NikolinoDE
    Platinum Contributor

    666_666666 

    Here is an example of VBA code that makes a custom tab the active tab using the ActivateTab method of the IRibbonUI object:

     

    Public myRibbon As IRibbonUI
    
    Sub tabActivate(ByVal control As IRibbonControl)
        myRibbon.ActivateTab(control.ID)
    End Sub

     

    untested.

    • 666_666666's avatar
      666_666666
      Copper Contributor
      That's not gonna work.
      I don't quite understand how it should look like:
      Or[
      ("control.TabDeveloperExcel")
      "control.TabDeveloperExcel"
      ("TabDeveloperExcel")
      "TabDeveloperExcel"
      /]

Resources