Custom Ribbon onload Questions

kal0123456789

New Member
Joined
Jan 4, 2022
Messages
6
Office Version
  1. 2010
Platform
  1. Windows
I am building a ribbon which can shows a custom tab in a certain workbook.

This is the sample code on the ribbon:
XML:
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="onLoad">
   <ribbon>
    <tabs>
      <tab id="MyTab" label="Custom">
          Bunch of stuff here         
      </tab>
    </tabs>
  </ribbon>
</customUI>

This is the vba code of onLoad:
VBA Code:
Public myRibbon As IRibbonUI
Sub onLoad(ribbon As IRibbonUI)
    Set myRibbon = ribbon
End Sub

"MyTab" still shows in the other workbook. How do I make "MyTab" shows in one particular Excel file, for example "Template.xlsx" but not the other workbooks or Excel files? And even better, if another person creates "Template.xlsx" and import this ribbon, "MyTab" won't show up also(so must be my file instead of created ones)?
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type

Forum statistics

Threads
1,215,772
Messages
6,126,801
Members
449,337
Latest member
BBV123

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