简体   繁体   English

保护Excel中更改事件上使用的宏的密码

[英]Password to protect macro used on the change event in excel

I know that a vba macro can be password protected. 我知道vba宏可以受密码保护。 I was wondering if the same could be applied to an event change macro? 我想知道是否可以将相同的内容应用于事件更改宏? If yes then how would you go about it. 如果是,那么您将如何处理。

"To protect your code, open the Excel Workbook and go to Tools>Macro>Visual Basic Editor (Alt+F11). Now, from within the VBE go to Tools>VBAProject Properties and then click the Protection page tab and then check "Lock project from viewing" and then enter your password and again to confirm it. After doing this you must save, close & reopen the Workbook for the protection to take effect." “要保护您的代码,请打开Excel工作簿并转到“工具”>“宏”>“ Visual Basic编辑器(Alt + F11)。现在,从VBE中转到”工具> VBAProject属性”,然后单击“保护”页面选项卡,然后选中“锁定“从查看中查看项目”,然后再次输入密码进行确认。完成此操作后,您必须保存,关闭并重新打开工作簿,以使保护生效。”

Source: http://www.ozgrid.com/VBA/protect-vba-code.htm 资料来源: http : //www.ozgrid.com/VBA/protect-vba-code.htm

This was an easy google, I reccomend you look online before asking on Stack Overflow, these simple questions are generally not well received. 这是一个简单的Google,我建议您先在线查看,然后再问Stack Overflow,这些简单的问题通常不太受欢迎。

If your question is about protecting a specific part of your code, and not the other parts of the code, then it can't be done as far as I know. 如果您的问题是关于保护代码的特定部分,而不是保护代码的其他部分,那么就我所知,这是无法完成的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM