Activate Custom Toolbar (Add-Ins) at Excel Workbook Opening

mmrm

New Member
Joined
Jun 29, 2021
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Is there any way to open a workbook with Add-Ins menu activated which has my custom command bar and buttons?
Excel usually opens with Home menu active, I'd make it change to Add-Ins menu active while I open my workbook. Any help?
I've spent a lot of time searching for any vba code for this. Nothing found. Excel macro recorder does not record any menu clicks so could not get any help there too.
Thank you.
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

Domenic

MrExcel MVP
Joined
Mar 10, 2004
Messages
19,758
First, add the following XML code to your workbook...

XML:
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Initialize"/>

If you need help in adding the XML code to your workbook, have a look at the following link...


Then, add the following VBA code in a regular module (Visual Basic Editor >> Insert Module)...

Code:
Option Explicit

Public MyRibbon As IRibbonUI

Public Sub Initialize(ribbon As IRibbonUI)
'
' Code for Initialize callback.
'
    Set MyRibbon = ribbon
    
    MyRibbon.ActivateTabMso "TabAddIns"
    
End Sub

Now, save, close, and re-open your workbook.

Hope this helps!
 

mmrm

New Member
Joined
Jun 29, 2021
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Thank you Domenic. I will try it and let you know. Thanks a lot for your response.
 

Forum statistics

Threads
1,144,391
Messages
5,724,075
Members
422,535
Latest member
navjeet

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
Top