Is there any necessity for executing set object = Nothing at the end of a sub when an object will go out of scope? It is of course good practice to manually free allocated memory (although even this is indirect since there's no demalloc-equivalent command).
The reason I'm asking is because in many code examples posted here, I've seen undeclared variables being used, but set object = Nothing being used to release memory in the same code sample. Kind of an inconsistent mix of style, which has got me wondering if maybe there is a reason for set objects to nothing (other than good style/practice).
According to faq707-3710, there doesn't appear to be a necessity--QUOTE:
if it is the only variable referencing the particular object, it disassociates the object from the code and releases all related system resources.
The reason I'm asking is because in many code examples posted here, I've seen undeclared variables being used, but set object = Nothing being used to release memory in the same code sample. Kind of an inconsistent mix of style, which has got me wondering if maybe there is a reason for set objects to nothing (other than good style/practice).
According to faq707-3710, there doesn't appear to be a necessity--QUOTE:
if it is the only variable referencing the particular object, it disassociates the object from the code and releases all related system resources.