Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The toolbar is being generated upon loading of the excel add-in via the
following code: Set cmdRW = CommandBars.Add(Name:="DT") With cmdRW With .Controls.Add(Type:=msoControlButton) .TooltipText = "New Sheet" .OnAction = "Sheet" .FaceId = 98 I know how to design a new button image when creating a toolbar manually, but how do I do so when creating the toolbar programtically? Thanks! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I found the following code, however the image is not displaying in the
toolbar, just a blank space...any help would be greatly appreciated! THanks Sub AddPictureToButton() Dim oShape As Shape 'Place the graphic in the document Set oShape = ActiveDocument.Shapes.AddPicture(FileName:= _ "PathAndNameOfPicture.gif") oShape.Select 'Copy graphic Selection.CopyAsPicture 'Delete from document Selection.Delete 'Copy the graphic to the first button on your toolbar 'Replace the name of the commandbar with your own CommandBars("TemplateCommandbar").Controls(1).Past eFace Set oShape = Nothing End Sub --------------------------------------------------------------------------------------------------------- wrote: The toolbar is being generated upon loading of the excel add-in via the following code: Set cmdRW = CommandBars.Add(Name:="DT") With cmdRW With .Controls.Add(Type:=msoControlButton) .TooltipText = "New Sheet" .OnAction = "Sheet" .FaceId = 98 I know how to design a new button image when creating a toolbar manually, but how do I do so when creating the toolbar programtically? Thanks! |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Instead of
.FaceId = 98 Put... .Picture = LoadPicture("C:\My picture location") Note that only certain file types can be used (I don't remember off hand which ones don't work). JNW " wrote: The toolbar is being generated upon loading of the excel add-in via the following code: Set cmdRW = CommandBars.Add(Name:="DT") With cmdRW With .Controls.Add(Type:=msoControlButton) .TooltipText = "New Sheet" .OnAction = "Sheet" .FaceId = 98 I know how to design a new button image when creating a toolbar manually, but how do I do so when creating the toolbar programtically? Thanks! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Toolbar Button Image Question | Excel Worksheet Functions | |||
How to increase size of image in button (msocontrolbutton) of custom toolbar of Excel | Excel Discussion (Misc queries) | |||
Load image from directory for custom toolbar of Excel 2000 | Excel Worksheet Functions | |||
custom toolbar buttons are saved where? Excel loads twice bymistake and all my custom toolbar buttons get gone!!! | Excel Programming | |||
saving toolbar buttons on custom toolbar | Excel Programming |