by Sisyphus » Tue Jan 17, 2012 12:41 am
Hi,
There are four steps to operating a form which you may want to keep an eye on: Load, Show, Hide and Unload.
On Load you load the form into memory but don't show it.
On Show the form becomes visible. You can't show a form that isn't loaded!
On Hide the form becomes invisible. If the form is modal the code will stop until you hide it.
On Unload the form is removed from memory. Obviously, you can't unload a form while it is showing, and be it only for the reason that you can't execute any code while it is still showing (except for code to operate the form EXCEPT to unload it).
Excel has grouped the Load action into the Show action, presuming that you want to load it since you expressed your wish to look at it. Quite possibly, Excel has done the same for the Unload event, presuming that you don't need to see it any more if you decide to unload it. For whatever reason, I suspect, Excel 2010 may not ahve inherited this presumptuousness and may insist that you hide the form before you can unload it.
There are many ways to load, show, hide and unload a form. They don't all function the same way and it is quite likely that some one will tell me it has always been this way or that and there is nothing new in Excel 2010 in this regard. For you, that kind of squabble doesn't matter because your problem is in that your form behaves differently from what you are used to. If you hide the form instead of unloading it you will not have a virgin form when you show it next. Data may have been retained in it and the initialize event won't fire. If you never unload it it will be unloaded when you close the application.
I hope that helps.
Have a great day!
Sisyphus
I do this for "honour and country" - much less of the latter, actually.
If I helped you, award points, plenty of them.
If I bored you, deduct points for being too long-winded. (I know, :lol)