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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add VbaProject password via VB code

Status
Not open for further replies.

pandpp

Programmer
Sep 17, 2003
110
AU
Hello,

It's been a while, but I have previously added VBA code to an Excel project via VB.

What I am now seeking is guidance on how to protect, via a password, the Project code, from within VB.

I have found the Protection property of the VBComponent within the "Microsoft Visual Basic for Applications Exrtensibility 5.3" object, only, it is a read only property.

Does any one know if there is a method available to protect the VBA code?
I need to put a DB Super User username & password in the code & obviously want it relatively safe.
I can't lock the code manually, since the password is going to change over time, hence the dynamics.

Thank you in advance for any suggestions.

Peter.

Excel 2002
 
Hi Peter,

AFAIK the only way to do this is with the Project Properties dialog and Sendkeys. I'd be interested to see another way but if no-one comes up with anything, I'll see if I can root out some code. But I don't really understand what you are trying to do - are you wanting to periodically run against, say, all Workbooks in a Folder and change the password or something similar?

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at VBAExpress[
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top