-
Re: Launching userform
John Alexander Jun 21, 2016 8:10 AM (in response to A. D.)This may not be the appropriate technique but it gets the job done. I clarify ambiguity about which sub should run by only defining one public sub called 'main'. If I need another public sub, I define it as a function with no return value specified. Again, probably not the correct approach but it works for me.
-
Re: Launching userform
A. D. Jun 21, 2016 10:34 AM (in response to John Alexander)As a enhancement, i made sure to only have 1 sub called ´main´ in my whole project.
In this one sub called main, the only code that exists is:
Sub Main
Userform1.show
End Sub
This launches the userform1.initialize event, which is all i wanted to have.
Thanks for your help both of you!
-
-
-
Re: Launching userform
Matt Martens Jun 21, 2016 8:29 AM (in response to A. D.)Whenever you run a macro in the manner you describe, it will automatically execute the last sub routine on the main module. You can either do as John suggested and change all the subs to functions except the one you wish to execute on Run or you can move the desired sub to the position that gets automatically run on Run.