View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default How to see all variables?

Variables are released when they go out of scope and the sub or function
where they are declared ends. If you don't have any global variables, then
you won't have a concern. If you do, then they will still be loaded until
the workbook is closed. There is usually little reason to perform any overt
action against them. They aren't released in any event - the most you can
do is clear the value they hold (exception would be a dynamic array).

Sub Test1()
dim rng as Range
set rng = Range("A1:A10")

set rng = Nothing
' rng still exists in memory - it just has a value of nothing


End Sub

--
Regards,
Tom Ogilvy


"count" wrote in message
...
This is likely to be elementary - apologies in advance :)

Is there a command or something I can type in Immediate box to show me

what
variables and objects are still loaded?
I don't much believe in my coding and always suspect that I failed to

Close
/ Nothing / Unload goods. Experience tells me that I really need this
facility.

I vaguely remember this sort of thing available in Realizer - first tool

to
program in Windows I used. Anybody remembers Realizer? It's like Spooky
Tooth or Grand Funk Railroad - excuse my memory lane :)

Regards,
Paul