Solved

prevent calculation from turning off

Posted on 2013-11-15
2
212 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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

730 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