Please Help - How can I assign an Image to a custom Toolbar
Posted by Paul E. on May 11, 2001 7:36 AM
I have wrtten VB code that creates a custom toolbar when an excel file is opened. I would like to assign an image to these buttons, but I can't figure out how. Below is an excerpt of the code I use, wherein I am currently assigning a caption to the button. I'd like to remove the caption and put a picture in its place. Any tips on how to accomlish this would be greatly appreciated. Thanks in advance
Private Const CTL_UPDATE As String = "Update"
Dim cbr As CommandBar
Dim ctlInsert As CommandBarButton
' Add button control.
Set ctlInsert = cbr.Controls.Add
.Style = msoButtonCaption ' Replace with msoButtonIcon
.Caption = CTL_UPDATE
.Tag = CTL_UPDATE
' Specify procedure that will run when button is clicked.
.OnAction = "Update"