-2

I got ErikaS' code to work from here: How to add a custom Ribbon tab using VBA?

I cannot respond to that thread.

It uses xml in a vba script to create a tab with buttons.

I have also gotten this method to work: Application.CommandBars(1).Controls.Add

Is there a way to combine the two methods? If I use Application.CommandBars, I can only add buttons to the Add-Ins tab. I cannot figure out how to access the tab I have added via the xml script. I also cannot add new tabs, only buttons to the Add-Ins tab. I would prefer to use xml as little as possible, because it is convoluted to pass it in via vba.

I'm using excel 2010, but it also has to work on excel 2016.

Community
  • 1
  • 1
CHM
  • 1
  • 3

1 Answers1

0

Command bars were deprecated and should not be used for customizing the UI in Office applications. Instead, you need to use the Fluent UI (aka Ribbon UI) to create a custom UI in Office applications:

For compatibility purposes command bar controls are added to the Add-ins tab. But that behavior may be changed at any point of time because they were deprecated and nobody can guarantee its work. However, ExecuteMso is the only valid method of command bars which can be used to call built-in controls programmatically.

Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45
  • Thanks. I'll stick with the xml version. Those links look like a good place to start. Is executeMso going to be of any use to me? – CHM Jun 24 '18 at 00:38