Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How do I reference a form that is located in an add-in xla file? The name of
the xla file is dailymods.xla so I tried: dailymods.userform2.show but it doesn't work. Ideas? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is the form opened?
try something like this workbooks.open filename:=dailymods.xla 'include path if necessary set frm = ActiveWorkbook 'reference for by this name or 'Workbooks("dailymods.xls") 'when using workbooks don't include path "Mike H." wrote: How do I reference a form that is located in an add-in xla file? The name of the xla file is dailymods.xla so I tried: dailymods.userform2.show but it doesn't work. Ideas? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I tried this but it doesn't work:
Set Frm = Workbooks("dailymods.xla") Frm.UserForm1.Show I am not sure I am understanding your suggestion. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In your dailymods.xla Include a sub or function to show the form, it
probably already has one, eg Function RunForm(a As String) As Variant UserForm1.Caption = a UserForm1.Show RunForm = "Return value" End Function One way to call RunForm from other projects is with 'Run', eg Sub test() Dim s As String, res s = "called from " & ThisWorkbook.Name res = Application.Run("dailymods.xla!RunForm", s) MsgBox res End Sub Regards, Peter T "Mike H." wrote in message ... How do I reference a form that is located in an add-in xla file? The name of the xla file is dailymods.xla so I tried: dailymods.userform2.show but it doesn't work. Ideas? |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
That worked! Thanks.
"Peter T" wrote: In your dailymods.xla Include a sub or function to show the form, it probably already has one, eg Function RunForm(a As String) As Variant UserForm1.Caption = a UserForm1.Show RunForm = "Return value" End Function One way to call RunForm from other projects is with 'Run', eg Sub test() Dim s As String, res s = "called from " & ThisWorkbook.Name res = Application.Run("dailymods.xla!RunForm", s) MsgBox res End Sub Regards, Peter T "Mike H." wrote in message ... How do I reference a form that is located in an add-in xla file? The name of the xla file is dailymods.xla so I tried: dailymods.userform2.show but it doesn't work. Ideas? |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
"Mike H." wrote:
How do I reference a form that is located in an add-in xla file? In a similar vein, but a little more basic, how do you create a form in VBA, or in Visual Studio and import it through VBA? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VBA open file from a form | Excel Discussion (Misc queries) | |||
Call user form from ThisWorkbook; close file if form closed | Excel Programming | |||
File in 2007 form - need to get back to 2003 form... | Excel Discussion (Misc queries) | |||
Open file from a form | Excel Programming | |||
Excel-Form to file.txt | Excel Programming |