View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
[email protected] jgwphansen@msn.com is offline
external usenet poster
 
Posts: 4
Default SubMenu .action argument

I have created a customized menu with submenus which I want to have run
the sub procedure "EnterInvoice" that passes a variable "VendorName"
from the .OnAction part of the With SubMenu CommandButton to the macro.
I have declared the argument in the sub as:

Sub EnterInvoice(ByVal VendorName)

but can't figure out how to do it.

I've tried different versions of the following but can not get the
syntax to work.

Set SubMenuItem = MenuItem.Controls.Add(Type:=msoControlButton)
With SubMenuItem
.Caption = "Co&mmissary Order"
.OnAction = "EnterInvoice"(Commissary)
End With

Ideas?

Thanks