View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Mitch Powell Mitch Powell is offline
external usenet poster
 
Posts: 37
Default Turn AutoCalc before calc takes place

Won't work since I can't control the mode that Excel is in when the workbook
is opened. Most users' machines are in autocalc mode as a matter of course.

"GTVT06" wrote:

On Jan 5, 12:19 pm, Mitch Powell
wrote:
It is critical that a particular workbook NOT calculate upon opening, so I
used the following:

Private Sub Workbook_Open()
Application.Calculation = xlCalculationManual
End Sub

The problem is that if calculation is is already in auto mode when workbook
is opened, calculation takes place before this code can run and turn it off.
Any ideas?

What if you were to have the workbook set the calculation mode to
manual before closing the workbook so next time it's opened it's
already set to manual and wont auto calculate?

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.Calculation = xlCalculationManual
End Sub