Application.DisplayAlerts = True 在 vba excel 代码中不起作用

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/26629167/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-12 05:02:47  来源:igfitidea点击:

Application.DisplayAlerts = True doesn't work in vba excel code

vbaexcel-2010

提问by Chrislaar123

I have a function that brings up the generic warning when merging two fields together. I want to suppress this message using vba. However after looking on the forums, I found that "Application.DisplayAlerts = True" should do the trick. However when I try to apply the code there is no option for Application. then display alerts. Do i have to import a specific library reference for this? I currently have Excel 14.0 imported..

我有一个函数可以在将两个字段合并在一起时显示通用警告。我想使用 vba 抑制此消息。但是在查看论坛后,我发现“ Application.DisplayAlerts = True”应该可以解决问题。但是,当我尝试应用代码时,没有应用程序选项。然后显示警报。我是否必须为此导入特定的库参考?我目前导入了 Excel 14.0..

回答by Chrislaar123

I found the resolution myself.

我自己找到了解决方案。

Because Application.DisplayAlerts = False was to set the access program that was calling on my create excel object to ignore any alerts displayed by access. So to solve it I simply wrote objExcel.DisplayAlerts = false

因为 Application.DisplayAlerts = False 是设置调用我的 create excel 对象的访问程序忽略访问显示的任何警报。所以为了解决它我简单地写了 objExcel.DisplayAlerts = false