I have seen Macro templates created by the developer team that i work with and tried my hand at making my own tab. The main issue i have is that the new tab doesnt allow me to rename it and i cannot make the buttons larger.
i have been looking up a file: officecustomuieditorfiles that was mentioned once. when i looked it up. i was directed to this site.
https://bettersolutions.com/vba/ribbon/custom-ui-editor.htm
and this download info directed after it says that windows 11 is no longer supporting it.
since im not allowed to download extra software at work:
Does anyone know how to create a new Custom macro tab that i can Rename & have the macro buttons be larger?
Any information or even points into a direction i can go would be much apprecaited.
aldo – here is a copy of my version that i was able to create:
http://www.vbaexpress.com/kb/getarticle.php?kb_id=427
Private Const COMMANDBAR_NAME As String = "Menu"
Private Const BUTTON_CAPTION As String = "Macros" ' Open
Private Sub Workbook_Open()
'https://learn.microsoft.com/en-us/office/vba/api/office.commandbarcontrols.add
'https://bettersolutions.com/vba/enumerations/msocontroltype.htm
'https://github.com/areed1192/sigma_coding_youtube/blob/master/vba/vba-advanced/commandbar-object/CommandbarControls%20Object.bas
'https://stackoverflow.com/questions/61918089/adding-macro-to-add-ins-tab-custom-toolbars
'franken start
Dim objCommandBar As CommandBar
Dim objButton As CommandBarButton
' Try to get the Commandbar (if it exists)
On Error Resume Next
Set objCommandBar = Me.CommandBars(COMMANDBAR_NAME)
On Error GoTo 0
If (objCommandBar Is Nothing) Then
' Create the commandbar
On Error Resume Next
Set objCommandBar = Application.CommandBars.Add(Name:=COMMANDBAR_NAME, Position:=msoBarTop, MenuBar:=False, Temporary:=True)
On Error GoTo 0
'msoBarTypeNormal
'msoBarTypeMenuBar
'msoBarTypePopup
'msoBarTop
'msoBarPopup
' Valid commandbar?
If (Not objCommandBar Is Nothing) Then
' Add the buttons to the command bar
With objCommandBar
' Add button
Set objButton = objCommandBar.Controls.Add(Type:=msoControlButton, Temporary:=True)
' Set the button properties
With objButton
.Style = msoButtonIconAndCaption
.Caption = "Clear"
.FaceId = 456
.TooltipText = "Clear"
.OnAction = "'" & ThisWorkbook.Name & "'!Clear"
.Height = 100
.Width = 100
End With
Set objButton = objCommandBar.Controls.Add(Type:=msoControlButton, Temporary:=True)
With objButton
.Style = msoButtonIconAndCaption
.Caption = "Combine_DF"
.FaceId = 1774
.TooltipText = "Combine_DF_Reports"
.OnAction = "'" & ThisWorkbook.Name & "'!Combine_DF_Reports"
.Height = 100
.Width = 100
End With
Set objButton = objCommandBar.Controls.Add(Type:=msoControlButton, Temporary:=True)
With objButton
.Style = msoButtonIconAndCaption
.Caption = "Inbound_Reports"
.FaceId = 526
.TooltipText = "Combine_Inbound_Reports"
.OnAction = "'" & ThisWorkbook.Name & "'!Combine_Inbound_Reports"
.Height = 100
.Width = 100
End With
Set objButton = objCommandBar.Controls.Add(Type:=msoControlButton, Temporary:=True)
With objButton
.Style = msoButtonIconAndCaption
.Caption = "Production"
.FaceId = 747
.TooltipText = "Tester Move_Production"
.OnAction = "'" & ThisWorkbook.Name & "'!Move_Production"
.Height = 100
.Width = 100
End With
With Application
.ShowToolTips = True
.LargeButtons = True
.ColorButtons = True
'.Caption = "&Menu" 'names the menu item
End With
' Show the command bar
.Position = msoBarTop
.RowIndex = msoBarRowLast
.Visible = True
MsgBox ("Macro's are located on the Add-In's menu tab")
End With
End If
End If
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
On Error Resume Next 'in case the menu item has already been deleted
Application.CommandBars("Worksheet Menu Bar").Controls("My Macros").Delete 'delete the menu item
On Error Resume Next
' Try to remove the iTrade command bar
Call Application.CommandBars(COMMANDBAR_NAME).Delete
' Restore error handling
On Error GoTo 0
On Error Resume Next
' Try to remove the iTrade command bar
Call Application.CommandBars(Menu).Delete
On Error GoTo 0
' Restore error handling
On Error Resume Next
' Try to remove the iTrade command bar
Call Application.CommandBars(TMenu).Delete
' Restore error handling
On Error GoTo 0
End Sub