Solved

prevent calculation from turning off

Posted on 2013-11-15
2
208 Views
Last Modified: 2013-11-15
Is there a way to prevent calculation from turning off [or another way of saying the same thing is I need to ensure that calculation remains on at all times]

I am running a macro that does several function that require calculation to be 'on'. Yesterday I discovered that the results were incorrect and when I investigated I discovered that my PC had turned calculation 'off'

is there a simple way to make sure that calculation is always 'ON' in VBA

thanks
0
Comment
Question by:Jagwarman
2 Comments
 
LVL 6

Assisted Solution

by:Michael
Michael earned 250 total points
ID: 39650745
Hi,

one approach is to add the following line to the beginning of your macro:
Application.Calculation = xlCalculationAutomatic

or add this to the ThisWorkbook object to set Calculation to automatic when the workbook is opened:
Private Sub Workbook_Open()
    Application.Calculation = xlCalculationAutomatic
End Sub

Joop
0
 
LVL 35

Accepted Solution

by:
[ fanpages ] earned 250 total points
ID: 39650831
Hi,

Just for information...

If you open two (or more) workbooks within the same MS-Excel session (same EXCEL.exe application instance), & one of those workbooks has been saved in an MS-Excel session where the Calculation Mode was set to Manual, then re-saving either workbook will cause this to carry the Manual setting with it when re-opened in any other MS-Excel session.

Consequently, you may find that opening two (or more) workbooks over time results in a majority of your workbooks adopting the Manual Calculation Mode setting; similar to a virus infecting your files!

This functionality is "by design" though.

There is a more detailed explanation here:
[ http://support.microsoft.com/kb/214395 ]

BFN,

fp.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Introduction This Article is a follow-up to my Mappit! Addin Article (http://www.experts-exchange.com/A_2613.html), it was inspired by an email posting I made to EUSPRIG (http://www.eusprig.org/index.htm), I will briefly cover: 1) An overvie…
This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now