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

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"

Forum statistics

Threads
1,215,819
Messages
6,127,047
Members
449,356
Latest member
tstapleton67

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