View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Leith Ross[_623_] Leith Ross[_623_] is offline
external usenet poster
 
Posts: 1
Default Adjusting individual icon size in commandbars?


Hello David,

Here is a technique that works with Excel 2000. Insert the picture you
what displayed as the button face onto the worksheet. Right click the
picture and Copy it.

Now, run the macro that creates your commandbar button and have the
..PasteFace method in the code. Below is a code example for a temporary
command button...


Code:
--------------------

Sub AddButton()

Dim CmdBar As CommandBar
Dim CmdBtn As CommandBarButton

Set CmdBar = Excel.CommandBars("Worksheet Menu Bar")
CmdBar.Controls.Add Type:=msoControlButton, ID:=1, Temporary:=True

Set CmdBtn = CmdBar.Controls(CmdBar.Controls.Count)

With CmdBtn
.Caption = "Test"
.Style = msoButtonIconAndCaption
.Visible = True
.PasteFace
End With

End Sub

--------------------


The copied picture will be resized automatically to fit your button.

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=557677