Protecting a macro

N

NZuser

Hello,
I have a spreadsheet which I've added a macro button onto to quickly
password protect all worksheets, I send this spreadsheet out to others and
have realised they can easily access the macro and unprotect the worksheets,
is there any way I can protect the macro so others can't run it?
:)
 
D

Daniel.C

Strange you did not receive a lot of answers...
You should lock your project to prevent accessing the code. However, be
aware that this is a weak protection.
HTH
Daniel
 
D

Daniel.C

In the VBE window, click on the project name (VBAProject...), right
click and choose "Properties", "Protect" tab and fill.
Daniel
 
M

macropod

Hi NZuser,

If you move the macro from the existing workbook to your Personal.xls file (see Excel Help for details), that means only you will
have access to the macro. That's far more secure than anything you can do that involves distributing the macro with the file.

An alternative is to not hardcode the password into the protection macro but to solicit the password via an InputBox.
 

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