Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel VBA show custom FaceID 1

Status
Not open for further replies.

xlStar

Technical User
Nov 16, 2003
55
GB
Below is tipical code to show custom menu etc...

With .Controls.Add(Type:=msoControlButton)
.Caption = "Time Sheet"
.FaceId = "1106"
.OnAction = "OpenTimeSheet"
End With


On Standard Excel (2002) you can able to 'Edit Button Image' via the Customize Dialog box.

It is possible to show that Edited Button via VBA?

I thought about .FaceId = myCustomButton

But how and where do I store the actual Edited Button Image?
 
xlStar,

Yes, you can. Follow these steps (I'm using Excel 2000 so the menu commands / dialogs might be somewhat different):

1. Edit your button image in the editor
2. From the Customize dialog select 'Modify Selection' then 'Copy Button Image' from the popup menu.
3. Close the Customize dialog
4. Select a location (cell) on the worksheet then Paste. The edited button image should appear. Rename it something relevant
5. In your VBA code, use something like:
Code:
Worksheets("SheetName").Shapes("BtnFace1").CopyPicture
oCBB.PasteFace
where "SheetName" and "BtnFace1" would be whatever your actual names are and oCBB is an object reference to the CommandBarButton you want to apply the custom face to.


Regards,
Mike
 


xlStar,

I notice that over the past fw days, you have posted 22 threads and have received many good tips related to your stated needs. Yet, you have responded NOT ONCE, to
[blue]
Thank Tek-Tip Contributor
for this valuable post!
[/blue].

The Stars accomplish several important things.

First, it gives positive feedback to contributors, that their posts have been helpful.

Second, it identifies threads as containing helpful posts, so that other members can benefit.

And third, it identifies the original poster (that's YOU, BTW), as a grateful member, that not only receives, but is willing to give tokens of thanks.

Skip,

[glasses] When a diminutive clarvoyant had disappeared from detention, headlines read...
Small Medium at Large[tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top