View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default Remove object from memory

Hi Lexcel,

See Chip Pearson's comments in the section entitled: 'Don't Use The New
Keyword In A Dim Statement'

http://www.cpearson.com/excel/variables.htm


---
Regards,
Norman



"lexcel" wrote in message
ups.com...

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