Show a userform which is in another VBA Project


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

Hi,

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?

Thanks!



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()
UserForm1.Show
End Sub

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

Dave


OzGrid Business Applications