Hide Macro

A

astrikor

I need to find some way of inhibiting access to macro code. I have a
autorun macro which needs to be able to run but which must not b
viewed or edited without a password.
"Private Sub test()" does hide the macro, but the code can still easil
be accessed by hitting "Esc" while it is running. Does anyone know ho
to introduce a password to enable access to code
 
N

Norman Jones

Hi Astrikor.

In the VBE (Alt-F11), with the project of interest selected:
Tools | VBA Project Properties | Protection
Lock and supply a password (Do not forget p/word!!)
Save, close and reopen file.
 
P

Paul B

Protect the VBA project,

To protect the VBA project, from your workbook right-click the workbook's
icon and pick View Code. This icon is to the left of the "File" menu this
will open the VBA editor, in Project Explorer right click on your workbook
name, if you don't see it press CTRL + r to open the Project Explorer then
select VBA project properties, protection, check lock project for viewing
and set a password. Press Alt and Q to close this window and go back to your
workbook and save and close the file. Be aware that this password can be
broken by third party software

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003
 
A

astrikor

Thanks guys.

Normans suggestion works well - except that Tools/VBA Project
properties is not available on my excel 2000, but I can get there from
View/Project Explorer - then highlight project and so to Project
Properties etc.
Incidentally, before someone asks why I am still using excel 2000 its
because it is much faster than 2003.
Astrikor
 

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