Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default What is lifetime of public variable?

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



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default What is lifetime of public variable?

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)

"John Wirt" wrote in message
...
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





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default What is lifetime of public variable?

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

"John Wirt" wrote:

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




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default What is lifetime of public variable?

Thank you, Antonio.
John



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default What is lifetime of public variable?

Thank you, Bob.
John


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Public variable Jack New Users to Excel 4 March 18th 06 09:35 PM
Declaring a Public variable as a Range and its lifetime John Wirt[_5_] Excel Programming 8 January 23rd 05 06:40 AM
scope/ lifetime of variable jeffP Excel Programming 5 September 19th 04 05:25 AM
scope/ lifetime of variable Norman Jones Excel Programming 0 September 18th 04 12:55 AM
module-level variable lifetime Jessie[_2_] Excel Programming 0 July 30th 03 09:31 PM


All times are GMT +1. The time now is 11:54 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"