Variables- How do I keep a Variable from being reset when closing excel 
Author Message
 Variables- How do I keep a Variable from being reset when closing excel

I would like to be able to keep the value of a variable
although I close excel.  I do not want my variable to be
reset when I close out of excel.

Thanks



Sun, 17 Apr 2005 23:10:46 GMT  
 Variables- How do I keep a Variable from being reset when closing excel
Tony,

You can save and retrieve registry values using the SaveSetting and GetSetting
functions.  You have limited control where in the registry they are stored
("HKCU\Software\Microsoft\VB And VBA Settings" or something like that), but the
functions are extremely easy to use.  See the help for more examples.

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC



Quote:
> Thanks Dave, but I would like to avoid saving it to a
> different workbook.  Ideally I would like to save it to
> the registry but I do not know how.  Is there sample code
> out there for saving variable to the registry?

> Thanks Again

> >-----Original Message-----
> >the most straight formward method is to save it on
> >aworksheet, if that isn't acceptable you can save it to
> >the registry, create another file (excle or text) and
> save
> >it there, choice depends on your skill and whether the
> >varaible needs to attributed to the user/machine or the
> >spreadsheet. If its the spreadsheet, then perhpas best to
> >save to a worksheet so that it is avaiable when user # 2
> >opens the file

> >dave

> >>-----Original Message-----
> >>I would like to be able to keep the value of a variable
> >>although I close excel.  I do not want my variable to be
> >>reset when I close out of excel.

> >>Thanks
> >>.

> >.



Mon, 18 Apr 2005 00:56:06 GMT  
 Variables- How do I keep a Variable from being reset when closing excel
Hi Tony,

Check out SaveSetting and GetSetting in the VBA help.

HTH

Peter Beach



Quote:
> Thanks Dave, but I would like to avoid saving it to a
> different workbook.  Ideally I would like to save it to
> the registry but I do not know how.  Is there sample code
> out there for saving variable to the registry?

> Thanks Again

> >-----Original Message-----
> >the most straight formward method is to save it on
> >aworksheet, if that isn't acceptable you can save it to
> >the registry, create another file (excle or text) and
> save
> >it there, choice depends on your skill and whether the
> >varaible needs to attributed to the user/machine or the
> >spreadsheet. If its the spreadsheet, then perhpas best to
> >save to a worksheet so that it is avaiable when user # 2
> >opens the file

> >dave

> >>-----Original Message-----
> >>I would like to be able to keep the value of a variable
> >>although I close excel.  I do not want my variable to be
> >>reset when I close out of excel.

> >>Thanks
> >>.

> >.



Mon, 18 Apr 2005 01:12:56 GMT  
 Variables- How do I keep a Variable from being reset when closing excel
Thanks Dave, but I would like to avoid saving it to a
different workbook.  Ideally I would like to save it to
the registry but I do not know how.  Is there sample code
out there for saving variable to the registry?

Thanks Again

Quote:
>-----Original Message-----
>the most straight formward method is to save it on
>aworksheet, if that isn't acceptable you can save it to
>the registry, create another file (excle or text) and
save
>it there, choice depends on your skill and whether the
>varaible needs to attributed to the user/machine or the
>spreadsheet. If its the spreadsheet, then perhpas best to
>save to a worksheet so that it is avaiable when user # 2
>opens the file

>dave

>>-----Original Message-----
>>I would like to be able to keep the value of a variable
>>although I close excel.  I do not want my variable to be
>>reset when I close out of excel.

>>Thanks
>>.

>.



Sun, 17 Apr 2005 23:54:19 GMT  
 Variables- How do I keep a Variable from being reset when closing excel
Only by saving it to a worksheet or other file before exit.

Regards
BrianB
===============================


Quote:
> I would like to be able to keep the value of a variable
> although I close excel.  I do not want my variable to be
> reset when I close out of excel.

> Thanks



Mon, 18 Apr 2005 20:50:10 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. reset all variables

2. reset variables

3. Help: Reset Variables, object exists etc.

4. Resetting array variables

5. Manipulation of control elements resets public variables

6. Can this be done without variables?

7. VBA resets my global variables

8. Resetting variables in userform

9. Resetting variables in VBA

10. Using a form seems to reset module-level public variables


 
Powered by phpBB® Forum Software © phpBB Group