Sub ResetContextMenu ()
Application.Commandbars("Cell").Reset
End Sub
I just tried this and it worked, try this and let me know if you have any issues.Hi T0ny84
Thanks for your quick reply
Getting syntax error ".MenuItems.AddMenu("This is my Custom Menu", 1)"
Is it something I need to modify?
Private Sub Workbook_BeforeClose(Cancel As Boolean)
' Removes the added menu when the workbook is closed.
Application.CommandBars("Cell").Reset
End Sub
Private Sub Workbook_Open()
Dim MyMenu As Object
Set MyMenu = Application.ShortcutMenus(xlWorksheetCell) _
.MenuItems.AddMenu("This is my Custom Menu", 1)
With MyMenu.MenuItems
'.Add "NameWantInMenu", "MacroName", ,OrderNumber, , ""
.Add "MyMacro1", "MyMacro1", , 1, , ""
.Add "MyMacro2", "MyMacro2", , 2, , ""
End With
Set MyMenu = Nothing
End Sub
Public Sub mymacro1()
MsgBox "Macro1 from a right click menu"
End Sub
Public Sub mymacro2()
MsgBox "Macro2 from a right click menu"
End Sub