I have a 16x16 image that I want to use for a context sensitive menu item I created. When a user right-clicks on a cell, the Cell CommandBar menu displays and my custom addition is at the bottom. I would like to put my own custom image in there instead of using a stock FaceId value. How do I do this? Can I have the image saved within the workbook (in a xlVeryHidden sheet) instead of having to load it? For example, I don't want :
.Picture = LoadPicture("C:\adidas_commandbar1.JPG")
I'd rather do something along the lines of (I want to reference the image from within the workbook):
.Picture = Sheets("Reference").Pictures("Picture 1")
Here's my code so far and it works:
Dim cbItem As CommandBarControl
Set cbItem = Application.CommandBars("Cell").Controls.Add 'Add new menu item
With cbItem
.BeginGroup = True 'Add separator bar
' .FaceId = 2138 ' I don't want to use this method!
.Picture = LoadPicture("C:\adidas_commandbar1.JPG")
.Caption = "Transfer Data to Master Sheet" 'Menu item caption (what the user sees on the menu
.OnAction = "'" & ThisWorkbook.Name & "'!PullData" 'Run this macro if selected
End With
Bookmarks