View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
gocush[_29_] gocush[_29_] is offline
external usenet poster
 
Posts: 252
Default Prompt for VBAproject password

ASKING for and getting the password is the easy part with a simple inputbox
at the beginning of the macro. The harder part is passing this password to
unlock the vba project. I think it can be done but don't know the code.
Does it not ask for the code automatically, as when you try to open a locked
project?

"Eric van Uden" wrote:

Hello newsgroup,

I have a macro that manipulates a workbook to make it a definitive version.
This includes replacing formulas with their values and deleting a code
module that is no longer needed.
The macro is executed with a button in the worksheet.
The VBAproject is locked with a password.

Now, of course, the macro that would delete the code module will not execute
because the project is locked.

Is there any way to prompt for the VBA password when the worksheet button is
pushed, then executing the macro when the project is unlocked?

I Hope I'm making sense. Thanks in advance for any suggestions.

Eric