如何在.xlam(加载项模块)文件中密码保护VBA(宏)代码? [英] How to password-protect VBA (macros) code inside .xlam (Add-In module) file?

查看:1118
本文介绍了如何在.xlam(加载项模块)文件中密码保护VBA(宏)代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个Excel加载项模块,因此我创建了一个.xlam文件。 现在,我想密码保护代码。 什么是程序?

I wanted to make an Excel Add-In module so I've created an .xlam file.  Now, I want to password-protect the code.  What is the procedure?

通过"密码保护代码",我不希望我的用户能够阅读代码。

By "password-protect the code", I don't want my users to be able to read the code.

这可能吗?

提前致谢。

推荐答案

如果加载项未加载,打开它。

If the add-in is not loaded, open it.

按Alt + F11激活Visual Basic编辑器。

Press Alt+F11 to activate the Visual Basic Editor.

单击Project Explorer中的加载项在左侧。

Click on the add-in in the Project Explorer on the left-hand side.

选择工具> VBAProject属性...(可能有一个不同的名称而不是VBAProject)。

Select Tools > VBAProject Properties... (there may be a different name instead of VBAProject).

激活保护选项卡。

勾选复选框"锁定项目以便查看"。

Tick the check box "Lock project for viewing".

输入要在"密码"中使用的密码。框和"确认密码"包装。

Enter the password that you want to use in both the "Password" box and the "Confirm password" box.

不要忘记密码!

点击确定。

按Ctrl + S保存加载项(必须从Visual Basic编辑器显式执行此操作 - 即使已修改加载项,Excel也不会提示您保存加载项。)

Press Ctrl+S to save the add-in (you must do this explicitly from the Visual Basic Editor - Excel won't prompt you to save an add-in even if it has been modified).

退出并重新启动Excel以查看效果。

Quit and restart Excel to see the effect.


这篇关于如何在.xlam(加载项模块)文件中密码保护VBA(宏)代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆