View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Wassim Wassim is offline
external usenet poster
 
Posts: 4
Default Load and Unload Form commands

R Avery wrote in message ...
When are these commands needed? I never seem to need to load or unload
a form in my code; all forms seem to be loaded all the time, and never
unload even after i use the unload frmMYFORM function. What do they do?


Hello

You asked about the Load and Unload commands as they apply to
Userforms.

I will give you some of my interpretation about these two commands:

Loading a form, places it in memory where you can manipulate it before
the user interact with it. Once the Show command is issued the form
will be displayed.

You will want to do this if you need to initialize the form, say you
want to hide objects on it, and have the user see a form that will
change based on some event, mainly user input. This loading of the
form can speed up the displaying of the form, if you have a
complicated form.

Well now the unload will simply remove the form from memory. That
means you can not refer to it, or manipulate it or its objects.

When an object is unloaded, it's removed from memory and all memory
associated with the object is reclaimed. That means you will lose all
user changes of the form.

It will be OK to hide the form, because hide still retains the memory
allocated, and thus you can still manipulate and grab information from
the form.

I always unload userforms when I am done, because of memory and
security issues.

I hope I answered your questions.

Wassim