Calculate only the active workbook before saving

こ雲淡風輕ζ 提交于 2019-12-10 11:03:43

问题


I have tried my level best to find an answer for this question and with no luck I am here posting my first question on stackoverflow.

Question: Can excel calculate only the active workbook before saving while other workbooks are open.

Scenario: I have a large workbook with multiple sheets of reports with formulas. The main control VBA creates multiple workbooks with multiple sheets of reports based on several variables. All report workbooks are converted to values on creation.

Problem: it takes around 20 seconds to calculate the main workbook. Thus when the VBA is trying to save and close the report workbook it calculates both the report and the main workbook which is creating performance issues.

Looking forward to your solutions.

Thanks in advance for your time.

Manoj.


回答1:


There is no built-in method of only calculating the active workbook (see https://excel.uservoice.com/forums/304921-excel-for-windows-desktop-application/suggestions/10601079-workbook-level-calculation for my suggestion to the Excel team about this).

You can switch off calculation for individual worksheets using Worksheet.Enablecalculation and you can stop Excel from calculating on save by switching off Application.CalculateBeforeSave, but both of these have potentially undesirable side effects.



来源:https://stackoverflow.com/questions/35192938/calculate-only-the-active-workbook-before-saving

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!