how do I check if a userform has been loaded?

S

stephenc

I have two macros (A and B) that load a common form. If I call B from within
A, I need to make sure that B doesn't load the form again, as I will end up
with multiple instances when I want just one. How do I check for this? In
simpleton terms I need this: "if myForm is not already loaded then load
myForm"
Advice welcome as always,
Stephenc
 
J

Jezebel

Instead of loading the form directly, create a third function, called from
either macro, that holds a static reference to the form: if the form is
loaded the reference is valid; if not, load it.
 
S

stephenc

Thanks for the tip. I had been using a setting in my INI file to indicate
whether the for was loaded, but it is not a very nice. Yours is better.
Thanks :)
 

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