How can I prevent calculations upon opening workbook?

G

Guest

I have the following macro that works great upon exiting my workbook but how
can I modify it to prevent calculations from running whenever someone opens
it? There are so many formulas and so much data on each sheet that if we
don't calculate each sheet manually, then we have to end task on Excel
because it will not complete the calculations.

Thanks!

Randy

Private Sub Workbook_Open()

With Application
.Calculation = xlManual
.CalculateBeforeSave = False
End With

End Sub
 
J

Jim Rech

If a workbook needs to be calced and calc mode is automatic Excel will calc
it upon opening it before startup macros run. So setting calc mode to
manual in Sub Workbook_Open is too late. Set it to manual before opening.
 
G

Guest

Makes sense but I have not been able to figure out how. Any help would be
appreciated.

Thanks!
 
D

Dave Peterson

Open excel with a blank (new) workbook.
Change the calculation mode
file|open your workbook
 
G

Guest

That's what I currently do. I was just hoping there was something
programatically that could be done.

Thanks!
 
D

Dave Peterson

Jim's point was that there was nothing you could do in that workbook that would
help.

But you could use two workbooks.

The first workbook changes calculation to manual, then opens the real workbook,
then closes itself (since it's done).

Kind of like:

Option Explicit
Sub auto_open()
Application.Calculation = xlCalculationManual
Workbooks.Open Filename:="c:\my documents\excel\book2.xls"
ThisWorkbook.Close savechanges:=False
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top