本文介绍了等到Application.Calculate完成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
解决方案
进一步说我的意见,您可以使用DoEvents与 Application.CalculationState
。看到这个例子
Application.Calculate
如果不是Application.CalculationState = xlDone然后
DoEvents
结束如果
'~~>其余的代码。
如果你想要也可以使用 Do While Loop
检查 Application.CalculationState
我也建议看到这个链接
主题:Application.CalculationState属性
链接:
从上述链接引用
Can I force my vba script to wait until Application.Calculate has finished to recalculate all the formulas?
解决方案
Further to my comments, you can use DoEvents with the Application.CalculationState
. See this example
Application.Calculate
If Not Application.CalculationState = xlDone Then
DoEvents
End If
'~~> Rest of the code.
If you want you can also use a Do While Loop
to check for Application.CalculationState
I would also recommend see this link
Topic: Application.CalculationState Property
Link: http://msdn.microsoft.com/en-us/library/bb220901%28v=office.12%29.aspx
Quote From the Above Link
这篇关于等到Application.Calculate完成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!