Can I password protect VBA modules using a macro?

D

Don Wiss

Can I password protect VBA modules using a macro? I use a macro to prep
the workbook for release. It would be nice if password protecting the
modules could be part of this prepping routine.

Don <www.donwiss.com> (e-mail link at home page bottom).
 
D

Don Wiss

If you try, you'll have to rely on Sendkeys.

Here's a Ron de Bruin post of a Bill Manville macro:
http://google.co.uk/[email protected]

I wouldn't rely on this.

Most useful. Thanks. I'm not looking to bury a password in the code. I plan
to change it for each release. What I got out of the post was:

Sub LockCode()
SendKeys "+{TAB}{RIGHT}%V{+}{TAB}"
ActiveWorkbook.VBProject.VBE.CommandBars(1).FindControl(ID:=2578, recursive:=True).Execute
End Sub

Don <www.donwiss.com> (e-mail link at home page bottom).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top