kal0123456789
New Member
- Joined
- Jan 4, 2022
- Messages
- 6
- Office Version
- 2010
- Platform
- Windows
I am building a ribbon which can shows a custom tab in a certain workbook.
This is the sample code on the ribbon:
This is the vba code of onLoad:
"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)?
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)?