Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 220
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 220
Default Load and Unload Form commands

Thanks!
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
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 LunaMoon Excel Discussion (Misc queries) 0 July 28th 08 11:03 PM
User Form - how to load it Balan Excel Discussion (Misc queries) 4 May 20th 08 12:39 PM
form won't unload inquirer Excel Programming 1 May 26th 04 09:55 AM
can i have VBA & forms etc load then unload? Chris A[_3_] Excel Programming 0 November 20th 03 11:14 PM
Form Unload Khai[_2_] Excel Programming 0 August 4th 03 09:28 PM


All times are GMT +1. The time now is 02:03 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"