I don't want to go through the menu option since I don't want my users to
have to do that.
If I used Application.Calculation = xlCalculationManual and put it in the
Workbook_Open event, this fires if I just open Excel and causes an error:
Method 'Calculation' of object '_Application' failed. If I open the XLS
file directly it still calculates. Plus I will want auto calculation on
once the document is open. Turning it back on is going to cause everything
to recalculate.
I could set a flag so that in my function, when called, it does nothing if
the flag is set. The problem is knowing when to flip the flag back on so
that when the function is called AFTER the doc is open, it does something
again.
XP said:
Navigate to [Tools] then [Options] then [Calculation] tab. Click "Manual".
If you want this equivalent in code:
Application.Calculation = xlCalculationManual
to reset:
Application.Calculation = xlCalculationAutomatic
HTH
:
I have a worksheet that calls several user defined functions. Every time I
open up the file in Excel, I have to wait while it recalculates every cell
with a formula.
How do I prevent this from occurring on startup?