PDA

View Full Version : Calculation keeps getting changed



YellowLabPro
08-03-2007, 08:51 AM
I set my calculation mode to manual in the excel program. Something keeps changing it to automatic.
What should I look for? Could there be some event code somewhere?

Sir Babydum GBE
08-03-2007, 10:10 AM
I set my calculation mode to manual in the excel program. Something keeps changing it to automatic.
What should I look for? Could there be some event code somewhere?Who knows!? Could be that a macro is being run by that or another worksheet which switches calculation back on. As far as I understand Calculation changes affect the the whole application, so every workbook opened after the change will behave according to the new setting - so are you switching it off for one workbook, and then back on for another?

Anyhow - in the workbook you're wanting manual calculation to take place, why not use this code:Private Sub Workbook_Open()
With Application
.Calculation = xlManual
.MaxChange = 0.001
End With
ActiveWorkbook.PrecisionAsDisplayed = False
End Sub
In Excel press Alt+F11 to bring up the VBA window. Double-click the ThisWorkbook icon on the left and paste the above into the code window. That should switch calculation off every time you open that workbook.

You could right-click the sheet tabs too, click View Code, and check to see if there is any code similar to the above that switches it on.

I'm not really a VBA guru - so you may get better answers.

YellowLabPro
08-03-2007, 10:20 AM
Hello Sir Baby-


As far as I understand Calculation changes affect the the whole application, so every workbook opened after the change will behave according to the new setting
Yes.


so are you switching it off for one workbook, and then back on for another?
No. Something in a procedure is changing it w/out my knowledge. I was looking for a particular line of code to search on- I searched on "Calcu" to find any/every instance of Calculation to make sure there was nothing in any block of code that would be changing it w/out my knowledge.

I am quite sure this is not a huge ordeal- I will find it, I was just poking around to see if someone had experienced something similar and would share-- Thanks for your suggestion and piece of code, if I cannot find it soon, I will use that as a temporary fix. My sheet is big and if it starts calculating it takes 3-5 minutes to re-calc.... the workbook itself is over 60 mgs... so it is quite a pain if it gets into this mode...

cheers

Doug