如何在 VBA 应用程序中隐藏代码
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9425461/
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
How to hide code in VBA applications
提问by Abhijit Shelar
Is it possible to hide VBA code, normally accessible from Excel's VBA Editor (Alt-F11), from a user's prying eyes? Can I, for instance, sign it with a digital signature?
是否可以从用户的窥探中隐藏通常可以从 Excel 的 VBA 编辑器 ( Alt- F11)访问的 VBA 代码?例如,我可以用数字签名对其进行签名吗?
Standard VBA project password protection is not suitable in this case because it can be cracked relatively easily.
标准的 VBA 项目密码保护不适合这种情况,因为它相对容易破解。
回答by Siddharth Rout
Yes. In the VBA main menu, click on Tools | VBAProject Properties and under the tab "Protection", Check the box "Lock project for viewing" and enter the password.
是的。在 VBA 主菜单中,单击工具 | VBAProject 属性并在“保护”选项卡下,选中“锁定项目以供查看”框并输入密码。
Save and exit the Excel file. When you open it next the code will be hidden.
保存并退出 Excel 文件。当您接下来打开它时,代码将被隐藏。
Sid
锡德