Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Load and Unload Form commands
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? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Load and Unload Form commands
I personally have never used Load since a Show will do a Load if needed. I
suppose if you had a long initialization routine you might do a separate Load so the eventual Show is not delayed. Unload clears the form from memory, so besides freeing the memory, it would cause the form to re-initialize the next time it is shown. If you just do a Hide the form will retain its current control values at the next Show. -- Jim Rech Excel MVP "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? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Load and Unload Form commands
This loading of the
form can speed up the displaying of the form, if you have a complicated form. So you say Load Userform1 Userform1.Show is faster than Userform1.Show Interesting. 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. Unload Userform1 Userform1.Textbox1.Value = "ABC" will not reference the old instance of Userform1, but it will load a new instance of userform1 and manipulate textbox1. (an explicit load is not required). -- Regards, Tom Ogilvy "Wassim" wrote in message m... 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 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Load and Unload Form commands
Thanks!
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Is there a way to unload the loaded XLL file in Excel? Hi all, I amdebugging XLL link library using Visual C++. Everytime I rebuild the XLL, Ihave to close the whole Excel program and relaunch the Excel program again,and then load in the newly gene | Excel Discussion (Misc queries) | |||
User Form - how to load it | Excel Discussion (Misc queries) | |||
form won't unload | Excel Programming | |||
can i have VBA & forms etc load then unload? | Excel Programming | |||
Form Unload | Excel Programming |