PC Review


Reply
Thread Tools Rate Thread

Display the current value of an Options setting

 
 
Michael R
Guest
Posts: n/a
 
      11th Dec 2007
I want to display the current setting of Tools / Options / Calculation
("Manual" or "Automatic" or "Automatic except tables") in a cell of my
workbook.

Question 1:
The following UDF does half-work: it displays correctly when I switch from
Manual to Automatic but not the other way round. What's wrong?

Function Get_Calc(Sheet As String) As Long
With Application
Get_Calc = .Calculation
End With
End Function

Question 2:
Only by trying have I found the following results from my UDF - is that
correct? where can I find a comprehensive overview of these value/setting
correlations?
-4135 = Manual
-4105 = Automatic
2 = Semi Automatic
 
Reply With Quote
 
 
 
 
John Bundy
Guest
Posts: n/a
 
      11th Dec 2007
Your numbers are correct, but why don't you just try the built in
functionality?
=INFO("recalc")
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"Michael R" wrote:

> I want to display the current setting of Tools / Options / Calculation
> ("Manual" or "Automatic" or "Automatic except tables") in a cell of my
> workbook.
>
> Question 1:
> The following UDF does half-work: it displays correctly when I switch from
> Manual to Automatic but not the other way round. What's wrong?
>
> Function Get_Calc(Sheet As String) As Long
> With Application
> Get_Calc = .Calculation
> End With
> End Function
>
> Question 2:
> Only by trying have I found the following results from my UDF - is that
> correct? where can I find a comprehensive overview of these value/setting
> correlations?
> -4135 = Manual
> -4105 = Automatic
> 2 = Semi Automatic

 
Reply With Quote
 
John Bundy
Guest
Posts: n/a
 
      11th Dec 2007
Or if you want it in code do it the easy way;
If Application.Calculation = xlCalculationManual Then calcmode "Manual"
If Application.Calculation = xlCalculationAutomatic Then calcmode "Automatic"
If Application.Calculation = xlCalculationSemiautomatic Then calcmode
"Semi-Automatic"
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"Michael R" wrote:

> I want to display the current setting of Tools / Options / Calculation
> ("Manual" or "Automatic" or "Automatic except tables") in a cell of my
> workbook.
>
> Question 1:
> The following UDF does half-work: it displays correctly when I switch from
> Manual to Automatic but not the other way round. What's wrong?
>
> Function Get_Calc(Sheet As String) As Long
> With Application
> Get_Calc = .Calculation
> End With
> End Function
>
> Question 2:
> Only by trying have I found the following results from my UDF - is that
> correct? where can I find a comprehensive overview of these value/setting
> correlations?
> -4135 = Manual
> -4105 = Automatic
> 2 = Semi Automatic

 
Reply With Quote
 
Michael R
Guest
Posts: n/a
 
      11th Dec 2007
John,

Thanks for that - I was not aware of the Info("recalc") function.

But:

It has the same "problem" as my UDF: when switching from automatic to
manual, the function would not update and remain on automatic.
Can we do anything about that?
(I work with 2002/SP3)

"John Bundy" wrote:

> Or if you want it in code do it the easy way;
> If Application.Calculation = xlCalculationManual Then calcmode "Manual"
> If Application.Calculation = xlCalculationAutomatic Then calcmode "Automatic"
> If Application.Calculation = xlCalculationSemiautomatic Then calcmode
> "Semi-Automatic"
> --
> -John
> Please rate when your question is answered to help us and others know what
> is helpful.
>
>
> "Michael R" wrote:
>
> > I want to display the current setting of Tools / Options / Calculation
> > ("Manual" or "Automatic" or "Automatic except tables") in a cell of my
> > workbook.
> >
> > Question 1:
> > The following UDF does half-work: it displays correctly when I switch from
> > Manual to Automatic but not the other way round. What's wrong?
> >
> > Function Get_Calc(Sheet As String) As Long
> > With Application
> > Get_Calc = .Calculation
> > End With
> > End Function
> >
> > Question 2:
> > Only by trying have I found the following results from my UDF - is that
> > correct? where can I find a comprehensive overview of these value/setting
> > correlations?
> > -4135 = Manual
> > -4105 = Automatic
> > 2 = Semi Automatic

 
Reply With Quote
 
John Bundy
Guest
Posts: n/a
 
      11th Dec 2007
There is really nothing that will do it all completely automatically.
Application.Volatile will force a UDF to update but calculation has to be on.
You can update it on a selection change of any kind but only by recalculating
the whole sheet(which defeats the purpose) or by knowing where each function
is and recalc just that cell.
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"Michael R" wrote:

> John,
>
> Thanks for that - I was not aware of the Info("recalc") function.
>
> But:
>
> It has the same "problem" as my UDF: when switching from automatic to
> manual, the function would not update and remain on automatic.
> Can we do anything about that?
> (I work with 2002/SP3)
>
> "John Bundy" wrote:
>
> > Or if you want it in code do it the easy way;
> > If Application.Calculation = xlCalculationManual Then calcmode "Manual"
> > If Application.Calculation = xlCalculationAutomatic Then calcmode "Automatic"
> > If Application.Calculation = xlCalculationSemiautomatic Then calcmode
> > "Semi-Automatic"
> > --
> > -John
> > Please rate when your question is answered to help us and others know what
> > is helpful.
> >
> >
> > "Michael R" wrote:
> >
> > > I want to display the current setting of Tools / Options / Calculation
> > > ("Manual" or "Automatic" or "Automatic except tables") in a cell of my
> > > workbook.
> > >
> > > Question 1:
> > > The following UDF does half-work: it displays correctly when I switch from
> > > Manual to Automatic but not the other way round. What's wrong?
> > >
> > > Function Get_Calc(Sheet As String) As Long
> > > With Application
> > > Get_Calc = .Calculation
> > > End With
> > > End Function
> > >
> > > Question 2:
> > > Only by trying have I found the following results from my UDF - is that
> > > correct? where can I find a comprehensive overview of these value/setting
> > > correlations?
> > > -4135 = Manual
> > > -4105 = Automatic
> > > 2 = Semi Automatic

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Get current Location (Regional and Language Options) Freddy Coal Microsoft VB .NET 3 31st Jul 2009 07:51 AM
In options, Current Database- Hide navigation pane Sharon Microsoft Access 2 31st Oct 2008 05:09 PM
no display after using double monitor and changing display setting =?Utf-8?B?d291dGVy?= Windows XP Basics 1 23rd Jul 2004 01:34 PM
Abit bh6 motherboard current era videocard options Don Lindbergh ATI Video Cards 7 31st May 2004 07:03 PM
Reinstall of XP Pro & select advanced options will I get more options but still be able to keep all of my current files & settings Vidiot Windows XP Help 1 19th Apr 2004 10:03 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:25 PM.