Citation :
One more thing to note on releasing objects. When you set an object to Nothing, as we said, youre making it so you cant use the object in your script anymore. However, if that object created a running instance of an application, that application will continue to run. Even ending the script doesnt do the trick; theres no memory keeping track of it anymore, but the application is still running, which of course uses memory itself. For example, the following line of code creates an instance of Microsoft Excel:
Code :
- Set objExcel = CreateObject("Excel.Application" )
|
If you run this line of code in your script, Excel will start. Doing this will not shut down Excel:
Code :
- Set objExcel = Nothing
|
|