Solved

prevent calculation from turning off

Posted on 2013-11-15
2
213 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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;…
This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

695 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