Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Put a procedure in workbook's project that contains the userform. Then you can
call that procedure. scott wrote: The sub "openDataForm" exists within the same add-in as the menu code. It's the form that's being called in the openDataForm sub. I need the long syntax to reference the form that resides in the workbook called "c:\data\my_workbook.xls". Sub openDataForm() frm_enterData.Show End Sub "Dave Peterson" wrote in message ... I'd use: Dim wkbk As Workbook Dim MenuItem As CommandBarControl Dim NewMenu As CommandBar Set wkbk = Workbooks("myaddin.xla") Set NewMenu = Application.CommandBars("somename here") Set MenuItem = NewMenu.Controls.Add _ (Type:=msoControlButton, temporary:=True) With MenuItem .Visible = True .Style = msoButtonCaption .Caption = "Enter Data" .OnAction = "'" & wkbk.Name & "'!openDataForm" End With scott wrote: I keep my custom menu in an add-in mymenu.xla. I'm trying to open a form called "frm_enterData" that resides in a seperate workbook called myWorkbook. A snipplet of my mymenu.xla menu code that should open the form is listed in CODE 2. Do I need to specify the path of the form's workbook's path before the name of the function that opens the form? If so, what would the syntax be? CODE: Sub openDataForm() frm_enterData.Show End Sub CODE 2: Set MenuItem = NewMenu.Controls.Add _ (Type:=msoControlButton) With MenuItem .Caption = "Enter Data" .OnAction = "openDataForm" End With -- Dave Peterson -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
want form to open without seeing worksheet | Excel Discussion (Misc queries) | |||
open in form mode | Excel Discussion (Misc queries) | |||
Using a template form, advance a form number everytime you open | Excel Discussion (Misc queries) | |||
Form is open ? | Excel Programming | |||
Is it possible to open the VBA form with a link in a sheet and to pass variable from a cell to the VBA form? | Excel Programming |