load userform from other VBProject (Excel 2000)

F

Fero Bokor

Hi all,

is it possible to load (to show) a UserForm from other VBAProject ?
There is a Reference between ActiveVBProject and the other VBAProject .
Thanks a lot ...

Fero
 
D

Dave Peterson

I put a sub in the first workbook that shows the userform.

Option Explicit
Sub Macro2()
UserForm1.Show
End Sub

In the calling workbook, I could do this:

Option Explicit
Sub Macro1()

' without a reference, I could use application.run
' Dim otherwkbk As Workbook
' Set otherwkbk = Workbooks("book1.xls")
' Application.Run otherwkbk.Name & "!macro2"

' with a reference, I could just call that macro
Call macro2

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top