保存前仅计算活动工作簿 [英] Calculate only the active workbook before saving

查看:107
本文介绍了保存前仅计算活动工作簿的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经尽力找到这个问题的答案,没有运气我在这里发布我的第一个问题在stackoverflow。

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.

情景:我有一个大型工作簿,带有多页报表,配有公式。主要控件VBA基于多个变量创建多个工作簿,其中包含多个报表。所有报告工作簿都将转换为创建价值。

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.

问题:计算主工作簿大约需要20秒钟。因此,当VBA尝试保存并关闭报表工作簿时,它会计算正在创建性能问题的报表和主要工作簿。

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.

期待您的解决方案。

提前感谢您的时间。

Manoj。

推荐答案

没有内置的只计算活动工作簿的方法(请参阅 https://excel.uservoice.com/forums/304921-excel -for-windows-desktop-application / suggestions / 10601079-工作簿级别计算,我对Excel小组的建议)。

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).

你可以关闭使用Worksheet.Enablecalculation的单个工作表的计算,您可以通过关闭Application.CalculateBeforeSave来停止Excel计算,但这两个都有潜在的不良副作用。

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.

这篇关于保存前仅计算活动工作簿的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆