Hi Guys,
it is a good practice to clean all VBA objects (like ranges, dictionaries) before macro exit?
What do you think ?
When should i do this?
Jacek
Hi Guys,
it is a good practice to clean all VBA objects (like ranges, dictionaries) before macro exit?
What do you think ?
When should i do this?
Jacek
Unless their scope means that they would remain in memory and you specifically don't want them to, it's generally a waste of time setting them to nothing in my opinion. (there are a few exceptions, such as when you have created cross-dependencies)
Rory
Thanks Rory!
Can you explain more about cross-dependecies what you mean?
Jacek
It only really applies if you have created your own classes and one stores a reference to another, which in turn stores a reference back to the first one. In such case, simply setting the objects to nothing will have no effect anyway unless you have implemented code to release the other object. It's a very niche case, which is why I put it as an afterthought!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks