Thread
:
Custom CommandBars
View Single Post
#
2
Posted to microsoft.public.excel.programming
Starwing[_3_]
external usenet poster
Posts: 3
Custom CommandBars
try it:
Sub CreateMenu()
On Error Resume Next
Application.CommandBars("example").Delete
Set myCB = CommandBars.Add(Name:="example",
Position:=msoBarFloating)
' Add a button to this bar
Set myCBtn2 = myCB.Controls.Add(Type:=msoControlButton)
Set menu3 = myCBtn2.CommandBar.Controls _
..Add(Type:=msoControlButton, ID:=1)
menu3.Caption = "Descriptive stat"
menu3.OnAction = "Your action"
menu3.FaceId = 17
myCB.Visible = True
End Sub
"Fan924" a écrit dans le message de news:
...
Here is a simple one button menu bar. How do I add a custom image to
replace the face ID? I can't find a good web reference for this.
Sub CreateMenr()
On Error Resume Next
Application.CommandBars("example").Delete
Set myCB = CommandBars.Add(Name:="example",
Position:=msoBarFloating)
' Add a button to this bar
Set myCBtn2 = myCB.Controls.Add(Type:=msoControlButton)
With myCBtn2
.FaceId = 17 ' <- Face Id 17 is a barchart icon
.Caption = "Descriptive stat"
End With
myCB.Visible = True
End Sub
Reply With Quote
Starwing[_3_]
View Public Profile
Find all posts by Starwing[_3_]