Where is the best place to put a "Load Form"? The app's "Auto_Open" event?
And "Unload Form"? In the app's "Auto_Close" or somewhere else?
Does a form automaticaly unload when Excel is closed?
Where is the best place to put a "Load Form"? The app's "Auto_Open" event?
And "Unload Form"? In the app's "Auto_Close" or somewhere else?
Does a form automaticaly unload when Excel is closed?
Whenever you need it.
in Excel e.g.
[VBA]
Private Sub Workbook_open()
userform1.show
end sub
[/VBA]
and
Whenever you don't need the userform anymore
[VBA]
Private Sub Workbook_BeforeClose(Cancel As Boolean)
unload Userform1
End Sub
[/VBA]
Since Load UserForm allocates memory to hold it, I only Load a UF when I will need it, and Unload it when I'm through with it.
Excel's garbage collection is pretty good, so when Excel closes, all the allocated memory is released
Paul
Thanks for both replies. I understand.