View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default Remove object from memory

I remember reading somewhere that an object won't be removed from memory
until ALL references to the object are set to nothing - which is what I think
Trevor is getting at.

"lexcel" wrote:


Thanks for the reply, but does this really remove the object from
memory as well?
What if I did the following:

Dim Fred as MyObject, George as New MyObject

Set Fred = George
Set George = Nothing

I could still access the same object through Fred, it is not erased
from memory.
For many built-in functions there is a Delete method, that is more like
what I am looking for.
Maybe may question should be:
How do I create a Delete method which frees the memory occupied by my
object?

With regards,

Lex