Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBAProject Password required when closing Excel

Status
Not open for further replies.

mcinernj

Programmer
Jul 30, 2004
4
CA
I have a Macro in Excel 2002 that when the workbook is opened runs and updates information contained within it.

I have protected the Project from viewing with a password.

When the user saves and closes the workbook and excel they are prompted for the VBAProject Password.

They can click "Cancel" twice and the box goes away, however is there a way around this?
 
This is not normal behaviour for password protected VBA. I assume that you have tried removing the password, seeing if the problem persists, and then re-setting it. Sometimes problems can be caused by applying a password to the VBA code when somthing is active in the Excel book. As a matter of interest, why do you need to protect the code from being viewed, as anyone seriously interested can hack the password in seconds ?
 
try this

Sub fin()

Do Until bob = "password"

bob = InputBox("enter the password")

Loop
ActiveWorkbook.Save
ActiveWorkbook.Close
End Sub
 
Thanks for the tip Tlb...I will try this.

The reason for the password is that this program is for a client and I don't want them to be able (easily) to mess up the code.
 
Yup - will also keep the projects active in the VBE - even when the workbook is closed.
Took about 1/2 day for that to annoy me enough to get rid of the desktop search ;-)

Rgds, Geoff

"Three things are certain: Death, taxes and lost data. Guess which has occurred"

Please read FAQ222-2244 before you ask a question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top