View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
vivmaha vivmaha is offline
external usenet poster
 
Posts: 42
Default VBA memory allocation

Hi,

I'm running a huge model on VBA, and I think i'm leaking memory.

In the following example, does the memory allocated for myInstance get freed
when I remove it from the collection? I assume that, like java, once the
memory is not referenced to, It gets deallocated.

dim myCollection as Collection
Set myCollection = new Collection
dim myInstance as MyClass
Set myInstance = new MyClass
myCollection.add myInstance
myCollection.remove 1

If the above does not free the memory, how do I do it?

Also, does VBA have constructors? And destructors?

Thanks.