MrExcel Publishing
Your One Stop for Excel Tips & Solutions

How to protect/unprotect a VBA Project using macro


Posted by Walter on November 22, 2001 7:43 PM


I want to protect/unprotect a VBA Project using macro.
I searched Help information but I found only a
property showing whether the VBA Project is protected.

If you know how to do that, please send me an email.
hy_woo@johnsonmotor.com

Thanks.


Posted by Ivan F Moala on November 23, 2001 3:30 PM

If you have the password then this can be done
using sendkeys.....I answered one some time ago

Repost if you can't find it.


Ivan

Posted by Walter on November 23, 2001 7:14 PM

Sorry I should state my goal in much detail.

What I am writing is a macro with one module and one form to install another macro (includes a number of macro modules and forms in the same workbook) and button on other computer. I want to remove that installer macro after it complete all necessary actions. As I need to protect the contents of both macro, I have to password protect the project and I don't want to use export method which generate temperary easily readable file. But, with password protection, I cannot remove module/form. I want to know how to use macro to unprotect and protect the project which can hardly be noticed by user, just like adding/removing vba components can be done without any message or ontop window showing all details. If you have the password then this can be done Ivan : : I want to protect/unprotect a VBA Project using macro. : I searched Help information but I found only a : property showing whether the VBA Project is protected. : If you know how to do that, please send me an email. : hy_woo@johnsonmotor.com : Thanks.