显示警报 VBA

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/17342300/
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-11 21:54:00  来源:igfitidea点击:

Display Alerts VBA

excelvba

提问by Sean Connecticut

I have a macro that has the in the top line (after dimming my variables) the two lines

我有一个宏,在第一行(在变暗我的变量之后)有两行

Application.EnableEvents = False
Application.DisplayAlerts = False

my issue is that despite having these during my macro I still get a pop-up asking me if I want to update links or not. Does anyone know why this may be happening / a way to fix it?

我的问题是,尽管在我的宏中有这些,我仍然会收到一个弹出窗口,询问我是否要更新链接。有谁知道为什么会发生这种情况/解决方法?

Thank you very much (I didn′t include my code because the reason the update links thing pop up is due to the documents I'm opening and not the code itself)

非常感谢(我没有包含我的代码,因为弹出更新链接的原因是我打开的文档而不是代码本身)

回答by Andre Pageot

If you want to apply this at the vba level any time during the execution of the code you can either apply the restriction at workbook level or at application level like so

如果您想在代码执行期间的任何时间在 vba 级别应用此限制,您可以像这样在工作簿级别或应用程序级别应用限制

WorkbookName.UpdateLinks = xlUpdateLinksNever
AppExcel.AskToUpdateLinks = False

回答by ApplePie

When you open workbooks, be sure to include UpdateLinks = false in the parameters.

打开工作簿时,请确保在参数中包含 UpdateLinks = false。

http://msdn.microsoft.com/en-us/library/office/ff194819.aspx

http://msdn.microsoft.com/en-us/library/office/ff194819.aspx

Specifies the way external references (links) in the file, such as the reference to a range in the Budget.xls workbook in the following formula =SUM([Budget.xls]Annual!C10:C25), are updated. If this argument is omitted, the user is prompted to specify how links will be updated.

指定文件中外部引用(链接)的更新方式,例如以下公式 =SUM([Budget.xls]Annual!C10:C25) 中对 Budget.xls 工作簿中范围的引用。如果省略此参数,则会提示用户指定如何更新链接。

(Emphasis mine)

(强调我的)

回答by Kazimierz Jawor

Second parameter of Workbooks.Open methodallows you to avoid pop-up asking for links update. Try to use the following syntax to update external links:

的第二个参数Workbooks.Open method允许您避免弹出请求链接更新。尝试使用以下语法更新外部链接:

Workbooks.Open path_file, TRUE, ...

of set it to FALSEto not update.

将其设置FALSE为不更新。

For additional information visit this MSDN link.

有关其他信息,请访问此 MSDN 链接。