View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
GS[_5_] GS[_5_] is offline
external usenet poster
 
Posts: 226
Default Check if UserForm is loaded?

Whenever you attempt to reference a Form it will load if it is not alrady
loaded. It's not a question of efficiency or lack of it.


As you can see by my previous post, I've gotten used to using
Load/Unload events with forms since using COM and VB6. As Dave aptly
points out, the Initialize event fires whenever a form is referenced.
In VB6, the Load event doesn't fire unless you execute it in code.

Either way, being a Rob Bovey student I've grown accustomed to using
object variables when creating instances of a form/userform because
that's what's exampled in most his books. Referencing the variable has
different behavior than referencing a VBA userform directly is the
lesson I've learned from Dave's suggestion. The problem lies where
there's code in the Initialize event, which I rarely use in VB6
projects.

Just another interesting difference between VB6 and VBA...
<g

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc