Hi there,
Try the following code and see if it does what you need. I've added a few extra parameters for you to play with if you feel like experimenting a bit 
Option Explicit
Sub CreateCommandBar()
' Assign a value of "False" if you want the CommandBar to be retained when Excel closes
Const bTEMPORARY As Boolean = True
' Use these constants for customising the CommandBar parameters
Const sBAR_NAME As String = "ACG Toolbar"
Const iBAR_LEFT As Integer = 100
Const iBAR_TOP As Integer = 200
' Use these constants for customising the CommandBarButton parameters
Const sBUTTON_CAPTION As String = " MENU "
Const sMACRO_NAME As String = "ACGMenu"
Const sTOOLTIP As String = "Display the Menu for the ACG Application"
Const iFACE_ID As Integer = 44
Dim cbr As CommandBar
Dim btn As CommandBarButton
' Before starting, delete any possible previous instance of the new CommandBar
On Error Resume Next
CommandBars(sBAR_NAME).Delete
On Error GoTo 0
' Create the CommandBar itself
Set cbr = Application.CommandBars.Add(Name:=sBAR_NAME, Temporary:=bTEMPORARY)
' Customise the new CommandBar
With cbr
.Visible = True
.Left = iBAR_LEFT
.Top = iBAR_TOP
End With
' Create the CommandBarButton itself
Set btn = cbr.Controls.Add(Type:=msoControlButton)
' Customise the new CommandBarButton
With btn
.TooltipText = sTOOLTIP
.OnAction = sMACRO_NAME
.Caption = sBUTTON_CAPTION
.FaceId = iFACE_ID
.Style = msoButtonIconAndCaption
End With
End Sub
I hope this helps - please let me know how you get on.
Regards,
Greg M
Bookmarks