LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Customizing the toolbar Icon

I am creating a custom Add-in that creates a toolbar on the users
excel. However, I want to create a custom icon by right-clicking on
the toolbar and then editing the image. When I do this however, the
next time I open excel, the customized image I created is lost. How
can I get it to save my cusome Image? Here is the code I used to
create the toolbar:


Sub CreateNewCommandBar()

Dim lcb_Bar As CommandBar

'' Delete any pre-existing CommandBar that uses our name
DeleteCommandbar gStr_CbarName

'' Set a reference to the CommandBar we create
Set lcb_Bar = CommandBars.Add(Name:=gStr_CbarName,
Position:=msoBarTop, Temporary:=True)

'' Create the controls

''Add AFE button
Dim AFE_button As CommandBarButton
Set AFE_button = lcb_Bar.Controls.Add(Type:=msoControlButton)
With AFE_button
.Style = msoButtonIconAndCaption
.Caption = "Get AFE Data"
.OnAction = "Get_AFE"
End With
''Add CC button
Dim CC_button As CommandBarButton
Set CC_button = lcb_Bar.Controls.Add(Type:=msoControlButton)
With CC_button
.Style = msoButtonIconAndCaption
.Caption = "Get CC Data"
.OnAction = "Get_CC"
End With

'' Ensure it is visible
lcb_Bar.Visible = True


End Sub

Function DeleteCommandbar(pStr_CbName As String) As Boolean
Dim x
Dim lBoo_tf As Boolean

lBoo_tf = False

For Each x In Application.CommandBars
If pStr_CbName = x.Name Then
x.Delete
lBoo_tf = True
End If
Next

End Function
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Customizing toolbar in Excel2007? mikelee101 Excel Discussion (Misc queries) 1 May 19th 09 07:59 PM
Customizing Excel Toolbar Tate Excel Discussion (Misc queries) 1 April 9th 07 04:43 PM
Customizing Toolbar Buttons Leo Minervini Excel Discussion (Misc queries) 0 April 6th 05 02:17 AM
Customizing toolbar buttons Alex[_18_] Excel Programming 1 February 25th 04 06:32 PM
Customizing Toolbar terri Excel Programming 1 February 11th 04 04:33 PM


All times are GMT +1. The time now is 06:43 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"