返回一个 XlCalculationState 常量,该常量针对 Microsoft Excel 中正在执行的任意计算,指示应用程序的计算状态。只读。
XlCalculationState 可为以下 XlCalculationState 常量之一。 |
xlCalculating |
xlDone |
xlPending |
expression.CalculationState
expression 必需。该表达式返回“应用于”列表中的对象之一。
在本示例中,Microsoft Excel 检查是否存在正在执行的计算。如果没有,则将计算状态消息显示为“Done”。否则就将其显示为“Not Done”。
Sub StillCalculating()
If Application.CalculationState = xlDone Then
MsgBox "Done"
Else
MsgBox "Not Done"
End If
End Sub