Can we customize the Ribbon at run time ?

Jaafar Tribak

Well-known Member
Joined
Dec 5, 2002
Messages
9,806
Office Version
  1. 2016
Platform
  1. Windows
Like adding a custom commandbar button and/or removing it dinamically via VBA code just like with xl 2003 and earlier .

Thanks.
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Ok let me see if I can explain this better.

It is not an actual button that i am looking to dinamically add to and remove from the Ribbon , rather it is a custom tab that I want to be able to add/remove or toggle its Visible Property.

I know one can toggle the Visible Attibute of a Button within a Tab via the getVisible attribute defined in the CustomUI.xml code such as:
Code:
getVisible="Button1_Visible"/>
and then the VBA callback as follows :
Code:
Sub Button1_Visible(control As IRibbonControl, ByRef returnedVal)
    returnedVal = boolResult
End Sub
Question:

Can we toggle the visible Attribute/Property of an entire custom tab as opposed to a control within the tab ?

I 've done some searching but no luck so far.
 
Upvote 0
xenou.

Thank you very much for all the links.

I too did manage to toggle the visible attribute of the custom tab in the end.
 
Upvote 0
Another question:
I want to open a hidden workbook (akin to personal.xlsb where Sheet1 is Hidden). Can I keep a custom ribbon that opens up with it when I hide Sheet1?

Normally when you hide any open sheets on a workbook the custom ribbons that the workbook opens hide away.
 
Upvote 0

Forum statistics

Threads
1,224,552
Messages
6,179,484
Members
452,917
Latest member
MrsMSalt

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top