gpt4 book ai didi

vba - Application.Interactive = True 失败

转载 作者:行者123 更新时间:2023-12-05 01:28:12 24 4
gpt4 key购买 nike

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

Application.Interactive = False
.... do work
Application.Interactive = True

出于某种原因,Interactive 没有设置回 true,即使我知道代码正在执行。

Excel 2013

有什么想法吗?

最佳答案

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 需要在使用它的函数上设置为 false,因为 Interactive模式阻止用户界面和 Volatile根据用户输入计算事物。当用户输入被阻止时,您不能指望评估用户输入的功能起作用。一个排除另一个 - 希望这是有道理的。

此外,检查您的 on error resume nexton error goto <label>语句,因为这会导致跳过一些代码,因此 Application.Interactive = True永远不会被处决。

关于vba - Application.Interactive = True 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19725592/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com