Excel2007中进行设置宏代码加密的操作方法
2017-03-28
相关话题
在Excel2007中我们设置了宏,宏代码就是VBA代码,那么有时我们需要防止别人复制使用我们的VBA代码或者改写我们的VBA代码,就要对其进行加密,如何进行VBA代码编辑器中的代码进行加密呢?今天,小编就教大家在Excel2007中进行设置宏代码加密的操作方法。
Excel2007中进行设置宏代码加密的操作步骤如下:
打开Excel2007启用宏的Excel文件。


同时按下ALT+F11键,打开VBA编辑器窗口。

查看对应的代码窗口,左侧VBA工程 PROJECT属性框中对应相应的SHEET表或者模块。

点击对应的SHEET表或者模块名称,鼠标右键放在其上,选择VBAPROJECT属性。

在弹出的VBAPROJECT工程属性窗口中-保护选项卡-选中查看时锁定工程,“查看工程属性的密码”内输入自己要设定的密码。

点击确认,然后点击文件工具栏内的保存按钮。

下次打开Excel文件时再同时按下ALT+F11进入VBA代码编辑器,鼠标左键双击左侧VBA工程中的VBAPROJECT文件名称,弹出VBAPROJECT密码输入窗口,输入密码才可进入,否则无法查看工程密码,呵呵。



注意事项:
ALT+F11键必须同时按下。
选择对象必须明确是模块设置密码还是SHEET表文件整个设置密码,看代码输入是在哪个对象内。