首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Application.Interactive = True失败

Application.Interactive = True失败
EN

Stack Overflow用户
提问于 2013-11-01 11:08:58
回答 1查看 2.1K关注 0票数 3

在工作表SelectionChange事件中,我设置了:

代码语言:javascript
复制
Application.Interactive = False
.... do work
Application.Interactive = True

由于某些原因,互动并没有恢复为真,即使我知道代码正在执行。

Excel 2013

有什么想法吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-11-01 11:15:41

代码语言:javascript
复制
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 nexton error goto <label>语句,因为这会导致跳过一些代码,因此Application.Interactive = True永远不会被执行。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/19725592

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档