I am having trouble creating a shortcut menu. I copied the following from the internet. It says to 'run' the code, so I put it in a module. When I run it, I get the error "User defined type not defined".
Sub CreateSimpleShortcutMenu()
Dim cmbShortcutMenu As Office.CommandBar
' Create a shortcut menu named "SimpleShortcutMenu.
Set cmbShortcutMenu = CommandBars.Add("SimpleShortcutMenu", msoBarPopup, False, True)
' Add the Remove Filter/Sort command.
cmbShortcutMenu.Controls.Add Type:=msoControlButton, ID:=605
' Add the Filter By Selection command.
cmbShortcutMenu.Controls.Add Type:=msoControlButton, ID:=640
Set cmbShortcutMenu = Nothing
End Sub
Anyone know what to do?