Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / November 2007

Tip: Looking for answers? Try searching our database.

Form In .xla file

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mike H. - 27 Nov 2007 11:28 GMT
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?
Joel - 27 Nov 2007 12:20 GMT
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

> 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?
Mike H. - 27 Nov 2007 12:41 GMT
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.
Peter T - 27 Nov 2007 12:59 GMT
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

> 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?
Mike H. - 27 Nov 2007 13:30 GMT
That worked!  Thanks.

> In your dailymods.xla Include a sub or function to show the form, it
> probably already has one, eg
[quoted text clipped - 22 lines]
> > dailymods.userform2.show
> > but it doesn't work.  Ideas?
Mike Reynolds - 29 Nov 2007 18:28 GMT
> 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?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.