View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Mike H. Mike H. is offline
external usenet poster
 
Posts: 471
Default Form In .xla file

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?