Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / March 2008

Tip: Looking for answers? Try searching our database.

Application.Calculation = xlCalculationAutomatic

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Karen53 - 01 Mar 2008 03:21 GMT
Hi,

How do I check the status of xlCalculation (Manual or Automatic) in a debug
statement?  

I tried

   Debug.Print "Starting NuTenant " & Application.Calculation

I'm getting results like  -4105 and -4135
Signature

Thanks for your help.
Karen53

Conan Kelly - 01 Mar 2008 04:04 GMT
Karen,

Those are the values of the different Calculation modes.

In the VBE, hit [F2], enter "xlCalculation" in the search box. In the Search
Results box, select any of the items that have "XlCalculation" in the Class
column.  Then in the "Members of 'XlCalculation'" pane below, select each
constant of the XlCalculation class, then look in the gray/tan box at the
bottom to see the values for each constant.

As far as returning the names......sorry, can't help you there.

HTH,

Conan

> Hi,
>
[quoted text clipped - 7 lines]
>
> I'm getting results like  -4105 and -4135
Rick Rothstein (MVP - VB) - 01 Mar 2008 06:06 GMT
As Conan mentioned, xlCalculationAutomatic and xlCalculationManual are
predefined constants for the numbers -4105 and -4135. By the way, there is a
3rd possible mode... 2 whose predefined constant is
xlCalculationSemiAutomatic. While somewhat ugly, you can use this statement
to print out what I think you want...

Debug.Print "Starting NuTenant: " & _
           Choose(((Application.Calculation + 4165) Mod 4077) / 30, _
                  "xlCalculationManual", "xlCalculationAutomatic", _
                  "xlCalculationSemiAutomatic")

It handles all three modes; however, if you never use
xlCalculationSemiAutomatic, then you can use this somewhat shorter statement
instead...

Debug.Print "Starting NuTenant: " & _
           Choose((Application.Calculation + 4165) / 30, _
                  "xlCalculationManual", "xlCalculationAutomatic")

Rick

> Hi,
>
[quoted text clipped - 7 lines]
>
> I'm getting results like  -4105 and -4135
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.