What is lifetime of public variable?

J

John Wirt

What is the lifetime of a Public variable?

Does it hold the variableas long as the Workbook remains open?

As long as Excel remains open? Suppose the Public vaiable is declared in
Personal.xls?

I need a means of making a variable that is a collection of ranges
"permanent"--that is, the variable lasts as long as the workbook stays open
at least.

Thank you.

John Wirt
 
B

Bob Phillips

Yes it is there as long as that workbook is open, or something else happens
that clears it. it can't be as long as Excel is open, as the workbook could
be closed before Excel and it is defined in the workbook.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 
G

Guest

John,

I presume this is related to your previous post about ranges and stacks.
If you store the "collection of ranges" as normal strings then you can save
them in Personal.xls. See my reply to implementing stacks in Personal.xls,
in your prev post.

Regards,
Antonio Elinon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top