View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Send menu call to explicit Sub

.OnAction = "MyWorkbookName.xls!AddBofQStandardPage"

Assume you don't have two procedures with that name in that workbook. If
the workbook isn't open, include the path.

--
Regards,
Tom Ogilvy


Stuart wrote in message
...
Am trying to direct a menu call to a specific Project and
Sub. The following attempt is not working:

With .Controls.Add(Type:=msoControlButton)
.Caption = "&Add a Standard Page"
.OnAction = "AddBofQStandardPage"
End With

More correctly, it is working, but is calling the sub
"AddBofQStandardPage" from a module in a different
Project.

How do I reference the sub in, say
Project1, Module1, when the the menu item is
triggered, please?

Regards.



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.520 / Virus Database: 318 - Release Date: 18/09/2003