Preventing users from changing macros

J

JS101

How do I prevent users from changing macro code in a workbook? There are
lots of options for protecting cells, but I don't see anything for preventing
a user from opening VBA and changing code.

Thanks.
 
D

Don Guillett

Use
Option Private Module
at the top of the module and they won't even see them.
Assign all to shapes/buttons
Password protect the code

Won't keep me out but will most.
 
B

Barb Reinhardt

Another way would be to add something like this

Sub MyProcedure(Optional myString as string)

It doesn't require the user to enter the string, but it's not displayed in
the list of Subs upon pressing ALT F8. Of course, they still could go to
the VBE and edit it there.

We've added a corporate digital signature to our assets. It won't prevent
changes, but it does make it easier for users to open workbooks with macros
and they are already enabled (once the signature is recognized on their
system).
 
G

Gord Dibben

Alt + F11

CTRL + r

Select your workbook/project and right-click>VBAProject
Properties>Protection

Follow your nose through there.


Gord Dibben MS Excel MVP
 

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