From the course: Excel VBA: Process Modeling

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Delete unneeded objects

Delete unneeded objects

From the course: Excel VBA: Process Modeling

Start my 1-month free trial

Delete unneeded objects

- [Instructor] After you have run a simulation, or written any other code that uses objects, you should delete the objects from memory. Excel has good memory management routines that usually free up your system resources after your code stops running, but it's still good practice to remove the objects when you're done with them. I'll demonstrate how to do that in this movie. My sample file is Chapter 02_06, and you can find it in the Chapter Two folder of your Exercise Files collection. I won't be doing any work with the sim setup worksheet, so I'll press Alt + F11 to move directly over to the Visual Basic Editor. You delete your objects from memory when you're done with them, and in this case, that means that will happen at the very end of the subroutine. So I will scroll all the way down to the bottom. And between next and the end substatement, I will set the collections to nothing to free up memory. So I will add a…

Contents