Sabtu, 03 Januari 2015

[ExcelVBA] Stopping calculation and iterations before save.

 

Hi all,
Saving some of my files takes very long.
I do have some calculations that need iterations (although I am now working on to change as much as I can), but I have mostly some functions that seem to be long to calculate.

If I manually turn off all calculation, including calculation before save, and also disable iterative calculation, then try to save, I sometime get a warning about the circular references (sometimes not), but usually it saves pretty fast.

Anyway I have tried this code in the ThisWorkbook code module:

Private Sub Workbook_BeforeSave()
With Application
.Iteration = False
.Calculation = xlManual
.CalculateBeforeSave = False
End With

End Sub

But if I have not unchecked everything manually before, it doesn't work at all.

Would could be wrong?

Thanks in advance, and Happy New Year to all!

Louise

__._,_.___

Posted by: garilou@cgocable.ca
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (1)
----------------------------------
Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go here: http://www.mousetrax.com/techtrax to enter the ezine, then search the ARCHIVES for EXCEL VBA.

----------------------------------
Visit our ExcelVBA group home page for more info and support files:
http://groups.yahoo.com/group/ExcelVBA

----------------------------------
More free tutorials and resources available at:
http://www.mousetrax.com

----------------------------------

.

__,_._,___

Tidak ada komentar:

Posting Komentar