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

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Have you tried the "Attach..." option on the Toolbars TAB on the View | Toolbars | Customize ..... menu?
 
Upvote 0

Forum statistics

Threads
1,214,940
Messages
6,122,356
Members
449,080
Latest member
Armadillos

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