ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Assigning custom commandbar buttons FaceID numbers (https://www.excelbanter.com/excel-programming/392812-assigning-custom-commandbar-buttons-faceid-numbers.html)

[email protected]

Assigning custom commandbar buttons FaceID numbers
 
I have several custom buttons that I have created in Excel that I
would like to load into a commandbar that is created when an xla file
opens. Does anyone know of a way to assign a "blank" FaceID number to
my custom buttons? In other words, can I add my custom buttons to the
Excel library of FaceID's?


Jon Peltier

Assigning custom commandbar buttons FaceID numbers
 
You cannot add your custom button images to Excel's list of FaceIDs.
However, you can copy the button image from an embedded picture in a
worksheet, and paste it onto a button:

ActiveWorksheet.Shapes("MyButton").CopyPicture xlScreen, xlBitmap
MyCommandButton.PasteFace

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


wrote in message
oups.com...
I have several custom buttons that I have created in Excel that I
would like to load into a commandbar that is created when an xla file
opens. Does anyone know of a way to assign a "blank" FaceID number to
my custom buttons? In other words, can I add my custom buttons to the
Excel library of FaceID's?




[email protected]

Assigning custom commandbar buttons FaceID numbers
 
Thanks Jon! Now I just have to figure out how to get my custom button
images into and embedded picture in a worksheet. Thanks again.


Jon Peltier

Assigning custom commandbar buttons FaceID numbers
 
1. Insert menu Picture From File

or

2. Copy in graphics program, hold Shift while selecting Edit Menu Paste
Picture.

When the picture is selected, go to the Name box (above cell A1, where it
says "Picture 1" or something similar), and type a useful name. In my
example I used "MyButton" but if you have several, use descriptive names for
what each button will do.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______



wrote in message
oups.com...
Thanks Jon! Now I just have to figure out how to get my custom button
images into and embedded picture in a worksheet. Thanks again.





All times are GMT +1. The time now is 10:00 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com