Good. Glad I was helpful.
See the following:
TimeDelay (4) ' VB interprests parens as indicating that
Set OutMail = Nothing ' there will be a return value. Donât use
OutApp.Quit ' parens for arguments to Subs.
TimeDelay 4 ' <ââââ<<< This line does nothing for you.
Set OutApp = Nothing ' (See explanation, below.)
When you use the key word âSet,â you establish a reference; all that does is give you a way to refer toâ and communicate with an object.
The Operating System counts references. If there are any references to a given object, the OS will not destroy that object.
(In the case of a reference to a running application, the running instance is
a referenceâso to speak.) When all the refernces are gone, and the app is closed, the memory and resources it used are released.
When a reference variable that refers to an application is set to nothing, all you do is lose the ability to communicate with the app through that variable. You need not wait for the app to close to set it to Nothing, and you need not set it to Nothing just because the app has been told to quit.
case, setting OutApp to Nothing is the right thing to do, but the time delay between .Quit and setting the OutApp to Nothing does nothing for you but slow your app down.