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
- [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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
Define process flow and programming goals55s
-
Declare variables used in the simulation6m
-
(Locked)
Define the Customers class and add a customer4m 48s
-
(Locked)
Define the Stations class and add a station8m 56s
-
(Locked)
Add code to calculate and write out times6m 2s
-
(Locked)
Delete unneeded objects1m 50s
-
(Locked)
Run the simulation1m 55s
-
(Locked)
Adapt the code for multiple runs4m 8s
-
(Locked)
-
-
-
-
-
-