在工作表SelectionChange事件中,我设置了:
Application.Interactive = False
.... do work
Application.Interactive = True由于某些原因,互动并没有恢复为真,即使我知道代码正在执行。
Excel 2013
有什么想法吗?
发布于 2013-11-01 11:15:41
Sub Main()
Debug.Print Application.Interactive
Application.Interactive = False
Debug.Print Application.Interactive
Application.Interactive = True
Debug.Print Application.Interactive
End Sub对我来说不会失败..。试试那个和see more here
由于您已经发现失败的原因,因此得出的结论可能是,在使用Application.Volatile的函数上,需要将Interactive设置为false,因为Interactive模式阻塞用户界面,Volatile根据用户输入计算事情。当用户输入被阻塞时,您不能期望一个评估用户输入的函数能够工作。一种排除另一种--希望这是有意义的。
另外,检查on error resume next或on error goto <label>语句,因为这会导致跳过一些代码,因此Application.Interactive = True永远不会被执行。
https://stackoverflow.com/questions/19725592
复制相似问题