add menu in excel

andre5

Board Regular
Joined
Aug 11, 2005
Messages
108
Good day

I'm using the below code to create a menu. It works 100%. How do I send it to an other user. I have seen someone sending an attachment and when double clicking on the attachment it creates the menu. How is it done? :oops:


Code:
Sub CreateMenu()
     Dim MenuObject As CommandBarPopup
    Dim MenuItem As Object
    Dim SubMenuItem As Object

 '    Call deletemenu

    Set MenuObject = Application.CommandBars(1). _
        Controls.Add(Type:=msoControlPopup, _
        Before:=10, Temporary:=True)
    MenuObject.Caption = "&Salaries"

    Set MenuItem = MenuObject.Controls.Add(Type:=msoControlButton)
    MenuItem.OnAction = "Opendb"
    MenuItem.Caption = "&Salary Adjustments"
 
    Set MenuItem = MenuObject.Controls.Add(Type:=msoControlButton)
    MenuItem.OnAction = "AboutMe"
    MenuItem.Caption = "Abou&t Program"
    MenuItem.BeginGroup = True
End Sub

EDIT: added code tags - Moderator
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Have you tried the "Attach..." option on the Toolbars TAB on the View | Toolbars | Customize ..... menu?
 
Upvote 0

Forum statistics

Threads
1,222,065
Messages
6,163,707
Members
451,854
Latest member
Tiffany Smith

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