Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default programmatically change icons on a menubar

Hello--how does one programmatically change the icons on a menubar? The
object browser is sort of cryptic on this point. More specifically, I
am looking to remove all icons from the buttons on my add-in menubar.
Thanks, Abe

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default programmatically change icons on a menubar

Are you referring to a menu that your addin creates? If so, it will be in
the code that creates the menu, and that would need adjusting.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

wrote in message
oups.com...
Hello--how does one programmatically change the icons on a menubar? The
object browser is sort of cryptic on this point. More specifically, I
am looking to remove all icons from the buttons on my add-in menubar.
Thanks, Abe



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default programmatically change icons on a menubar

Run ButtonStyles for a few ideas.

Sub newTestBar()
Dim i As Long

On Error Resume Next
CommandBars("TestBar").Delete
On Error GoTo 0

With CommandBars.Add("TestBar", msoBarFloating, False, True)

For i = 1 To 5
With .Controls.Add(msoControlButton)
.Caption = "Button " & i
.FaceId = i + 79
End With
.Visible = True
Next
End With
End Sub

Sub ButtonStyles()
Dim cBar As CommandBar
Dim cbb As CommandBarButton
Dim sty As Long, i As Long

On Error Resume Next
Set cBar = CommandBars("TestBar")
If cBar Is Nothing Then
newTestBar
Set cBar = CommandBars("TestBar")
End If
On Error GoTo 0

sty = msoButtonIcon ' 1
sty = msoButtonCaption ' 2
sty = msoButtonIconAndCaption ' 3

For i = 1 To 3
sty = i
For Each cbb In cBar.Controls
cbb.Style = sty
'to completely remove icon -
'cbb.FaceId = 1 or cbb.BuiltInFace = True
Next
Stop ' look at the bar
Next

' cBar.Delete ' uncomment to delete the bar
End Sub

Regards,
Peter T

wrote in message
oups.com...
Hello--how does one programmatically change the icons on a menubar? The
object browser is sort of cryptic on this point. More specifically, I
am looking to remove all icons from the buttons on my add-in menubar.
Thanks, Abe



Reply
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
How to change the icons on excel folders? Martin Excel Discussion (Misc queries) 1 December 12th 09 05:38 PM
Change Color of Icons Mrs. Fischer Excel Discussion (Misc queries) 2 February 19th 08 07:30 PM
Can I change the menubar to look like excel 2003? Rude Reality New Users to Excel 5 July 12th 07 03:39 AM
How to change cond. format icons in EXCEL 2007? PapaBear Excel Worksheet Functions 0 May 25th 06 05:20 PM
Change color of tool bar icons budcof Excel Discussion (Misc queries) 1 December 9th 05 03:17 PM


All times are GMT +1. The time now is 10:33 PM.

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

About Us

"It's about Microsoft Excel"