I'm using the Unload Me command to exit the program. The program closes but doesn't actually exit (using ctrl-alt-delete, the program shows as still running).
I'f never run into this problem with other programs i've developed.
Any suggestions?
Printable View
I'm using the Unload Me command to exit the program. The program closes but doesn't actually exit (using ctrl-alt-delete, the program shows as still running).
I'f never run into this problem with other programs i've developed.
Any suggestions?
Code:Unload Me
Set Form1 = Nothing
End
End is evil!
Click this smile icon: :rolleyes:
Hi,
you shoud be carefull because when you see this type of error, it usually means that something is working wrong !
Do you have "For ever" loops in your applcation, ie : are you purely programming with events and function or do you have functions that never exit your code ? This could be a reason that the form is always loaded into the Forms collection...
Also, is there a possibility that your programm calls for graphical controls on your form after the form unload as been called ? If so, the form WILL BE RELOADED.
Do some testing, put a break point into your form load event and close your application...
Hope I helped...
P.S. Do you speak french ( bonjour !!!) because if so, I could write it down in french, I'am from Québec Canada...
Yonatan, End is used to end applications, all apps arent always bound to forms and objects.
BTW, search all doevents statement and make emergency exits on at least the most your fequently used loops, for instance:
andCode:Do
'code
Doevents
Loop While Forms.count
Code:Do
'code
Doevents
If forms.count=0 then exit do
'code
Doevents
Loop While Forms.count
Hey guys...
Normally, applications should exit when there is no more forms in the Forms collections. That the way it's meant to be and it's the cleanest way to close an application.
When I see the END statement in someone's application (at work or else), 2 things run into my mind :
1) " Wow this guy really wanted me to know he was a VB programmer !!! "
2) " Now, what was going so bad in this application that the guy decided to PATCH a clean unload with the END statement ? "
There is something wrong into this application "Bonjour", think about it...
i did some tests again, none of the objects declared in standard modules unloads correctly, when you close the last form. Thats exactly the same symptoms as caused by End. Unload statement is Evil! Nah, But think about it, Standard Modules surely must be evil, if you use them, i can't think of a better way to end your app, without manually unloading all objects and variables in that module.
maybe and just maybe you have one form not visible, that´s
what happend to me once, i was opening another form to
display some information and y simply hide it after that
but when i use the Unload Me statment the app continue
runnig, until i found that mistake...
Saludos...;)