[VBA] Canceling close error in Workbook_BeforeClose

I have a workbook that enables iterative calculations when I open it and turns it off when I close it. It works well unless you cancel the "do you want to save" as you are closing the document. When you cancel it, the workbook stays open but Workbook_BeforeClose has already been executed so iterative calculations are off. How do I fix this? I want iterative calculations to be always on kf the workbook is open.

My closing code is: Private Sub Woorkbook_BeforeClose(Cancel As Boolean) Application.MaxIteratiins=100 Application.Iteration=False End Sub