Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Revert to xlCalculationAutomatic before workbook closes

Status
Not open for further replies.

blackduck

Programmer
Jun 11, 2002
119
AU
Is there a way to set the calculation back to automatic when the user closes this workbook but so that the workbook doesn't recalculate again before it closes?

I have the following code under ThisWorkbook:

Private Sub Workbook_Open()
Application.Calculation = xlCalculationManual
Application.CalculateBeforeSave = False
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.Calculation = xlCalculationAutomatic
End Sub

Thank you
 
Surely setting the calculation mode to automatic requires that the workbook recalculates?

Cheers, Glenn.

Did you hear about the literalist show-jumper? He broke his nose jumping against the clock.
 
yup

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Given that you set calculation to manual when the workbook is opened, I can't see any value in setting it to automatic on closure. What is the benefit in having auto-calculate switched on only when the workbook can't be updated?

Steve

[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object::perlDesignPatterns)[/small]
 
Kind of like having the fridge light on only when the door is closed...

Steve

[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object::perlDesignPatterns)[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top