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

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

Forum statistics

Threads
1,216,994
Messages
6,133,914
Members
449,846
Latest member
excelformanda

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