Excel FaceID - individual icons

Formula11

Active Member
Joined
Mar 1, 2005
Messages
468
Office Version
  1. 365
Platform
  1. Windows
Hi, is there anywhere these individual icons are available.

VBA Ribbon - Face Ids 2003
For the latest Office version though.

I was planning on inserting some of the images in a VBA userform.
 
Thanks for responding.
The Face Ids will be used in a useform to give similar command as Excel, mostly for Insert shapes, for example insert Text Box.

Probably best as original image file, it may or may not be an "ico" extension.

I didn't know about imageMso, but whatever is used in Excel commands.

1653869088808.png
 
Upvote 0

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Yes, those shape icons are also imageMso's, and they are also much easier to access with VBA that FaceIDs are.

For example, the imageMso for the Visual Basic button is "VisualBasic". So the following code will produce this image in the middle of the UserForm:
VBA Code:
Private Sub UserForm_Click()
Me.BackColor = vbWhite
Set Me.Picture = Application.CommandBars.GetImageMso("VisualBasic", 96, 96)
End Sub

1653870589821.png



There are lists online with all the imageMsos for you to look at. Alternatively, if you know the imagMSo codename, you can just replace "VisualBasic" in the code above with the imageMso. One way of finding them out, is you can hover over the image in the QAT customisation window. For example, here you can see in the brackets at the end: ShapeRoundedRectangle

Be careful to get the capitalisation correct, because imageMsos are case sensitive.

1653870868866.png



Does that seem like it might help?
 
Upvote 0
Thanks, this may be a better way if it works in the sense that the image is called up through code instead of attaching an image to the form.

At the moment I was going to attach an image to the Image control. When clicked, it would carry out the relevant procedure.
Essentially the same as clicking a Command Button but with an image.

So I will continue with this.
The third line is giving an error when run.

VBA Code:
Private Sub UserForm_Initialize()
    Me.BackColor = vbWhite
    Set Me.Picture = Application.CommandBars.GetImageMso("VisualBasic", 96, 96)
    'Set Me.Image1 = Application.CommandBars.GetImageMso("VisualBasic", 96, 96)
End Sub

1653873035164.png
 
Upvote 0
Using 4 image boxes, this is what I got:
VBA Code:
Private Sub CommandButton1_Click()
Set Image1.Picture = Application.CommandBars.GetImageMso("PageSetupPageDialog", 32, 32)
Set Image2.Picture = Application.CommandBars.GetImageMso("FileSave", 32, 32)
Set Image3.Picture = Application.CommandBars.GetImageMso("CalculateNow", 32, 32)
Set Image4.Picture = Application.CommandBars.GetImageMso("ScreenClipping", 32, 32)
End Sub
Are you using it in Excel?

1653874028285.png
 
Upvote 0
Solution
Using 4 image boxes, this is what I got:
VBA Code:
Private Sub CommandButton1_Click()
Set Image1.Picture = Application.CommandBars.GetImageMso("PageSetupPageDialog", 32, 32)
Set Image2.Picture = Application.CommandBars.GetImageMso("FileSave", 32, 32)
Set Image3.Picture = Application.CommandBars.GetImageMso("CalculateNow", 32, 32)
Set Image4.Picture = Application.CommandBars.GetImageMso("ScreenClipping", 32, 32)
End Sub
Are you using it in Excel?

View attachment 65844
I don't remember ever knowing this technique, thanks for sharing it. I just made myself a little UserForm to test it, so I can preview images by name and size. Interesting that the Set keyword is not required.

GetRibbonButtonImage.png
 
Upvote 0
I don't remember ever knowing this technique, thanks for sharing it. I just made myself a little UserForm to test it, so I can preview images by name and size. Interesting that the Set keyword is not required.

View attachment 68530
One other thing I've learnt is that transparency persists if you use a Label control (with the backstyle settings adjusted accordingly) versus an image control.
 
Upvote 0

Forum statistics

Threads
1,224,830
Messages
6,181,225
Members
453,025
Latest member
Hannah_Pham93

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top