Help: add new tab to the ribbon using vba macro

Ad new Tab

Create Ribbon Tab in the compiled application

xlCompiler gives you a very simple way to create Ribbon Tabs. Just a few lines of VBA code and your workbook receives new empty tab:

#If XLC Then
	With Application.Ribbon.Tabs
		With .Add
			.Caption = "Accounts"
			.Name = "Tab.Accounts"
		End With
	End With
#End If
	

How it works?

Application.Ribbon object has Tabs property. This object represents collection of the Ribbon Tabs. It is widely used in the Ribbon management code.

Method Add of the Tabs property creates new Tab Object and adds it to the collection.

Property Caption represents visible caption of the Tab.

Property Name represents internal Name of the Tab Object. We can refer to this object to name in the VBA code.