MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Show a userform which is in another VBA Project

Posted by camille on April 19, 2001 3:51 PM


I have a general macro in a XLStart file(say "file1") that I can call from another excel file ("file2"), writing in the code of file2:

Application.Run "file1.xls!generalmacro"

Now I want to show a userform which is also in file1, by calling it in the file2 code.

How can I do that?


Posted by Dave Hawley on April 19, 2001 7:30 PM

Hi Camille

Your sure can, in fact you are 99.9% of the way there already :o)

Just place a procedure with a normal module of File1.xls, something like:

Sub ShowMyForm()
End Sub

Then use:
Application.Run "file1.xls!ShowMyForm"


OzGrid Business Applications