vba 如何永久允许受信任的工作表的宏?

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

How to permanently allow macro for a trusted worksheet?

excelvbaexcel-2007

提问by htmlr

I've created a worksheet which is shared amongst my colleagues with a real simply macro to show/hide rows but everytime either I or one of my colleagues opens it they get prompted to Allow marco - is there anyway for them to permantly allow this macro?

我创建了一个工作表,在我的同事之间共享一个真正简单的宏来显示/隐藏行,但每次我或我的一位同事打开它时,他们都会被提示允许宏 - 无论如何他们是否可以永久允许此宏?

采纳答案by Ben McCormack

You need to change a setting in Macro Securitywithin Excel so that your colleagues don't have to respond to a dialog box every time. Be advised, though, that when you allow macro code to run automatically, this can unsuspectingly open you up to malicious code in other Excel workbooks.

您需要在 Excel中的宏安全性中更改设置,以便您的同事不必每次都响应对话框。但是,请注意,当您允许宏代码自动运行时,这无疑会使您暴露在其他 Excel 工作簿中的恶意代码面前。

The location of the settings for Macro Security is different from versions 2003 and 2007 of Excel. In 2003 and previous, I believe the setting is visible in Tools > Macros > Macro Security. From there, you would change the security level to low. In Excel 2007 (and probably 2010), the setting is visible in the Developer tab on the ribbon (which you might have to make visible by toggling a checkbox in Excel Options). From the Developer tab, click Macro Securityand chose Enable All Macros.

宏安全设置的位置与 Excel 2003 和 2007 版本不同。在 2003 年及之前,我相信该设置在工具 > 宏 > 宏安全中可见。从那里,您将安全级别更改为低。在 Excel 2007(可能还有 2010)中,该设置在功能区上的“开发工具”选项卡中可见(您可能必须通过在 Excel 选项中切换复选框使其可见)。从“开发人员”选项卡中,单击“宏安全”并选择“启用所有宏”。

The above is the simplest way for your colleagues to make a change to theirsystem, but a better way, as others suggest, would be to digitaly sign your own work so that your colleagues don't have to open a potential security hole on their own system.

以上是您的同事对其系统进行更改的最简单方法,但正如其他人建议的那样,更好的方法是对您自己的工作进行数字签名,这样您的同事就不必在他们的系统上打开潜在的安全漏洞自己的系统。

回答by J.T. Grimes

You'll want to digitally sign the project. Microsoft's information about how to do that is here: http://office.microsoft.com/en-us/excel-help/digitally-sign-a-macro-project-HA001231781.aspx

您需要对项目进行数字签名。微软关于如何做到这一点的信息在这里:http: //office.microsoft.com/en-us/excel-help/digitally-sign-a-macro-project-HA001231781.aspx