Icon in Menu Bar

G

Gordon

I am trying to use a VBA program to place a Icon in the Menu Bar.
Used Recorder and copyed into a macro, which place an invisiable incon
in the Menu Bar. Would like to see the Icon to, be a happy face with
text or just text. Can you help me?

Gordon
 
G

Guest

Example code:

Sub AddBtn()
'Temporary parameter will cause it to delete on closing Excel.
'Remove "(Temporary:=True)" to make permanent. Can still delete as normal.
With Application.CommandBars(1).Controls.Add(Temporary:=True)
.FaceId = 107 'use 59 for happy face
.Caption = "Update"
.TooltipText = "Updates data from main file"
.Style = msoButtonIconAndCaption 'for caption only use msoButtonCaption
.OnAction = "UpdateDataMain" 'name of macro to assign
End With
End Sub

Regards,
Greg
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top