prevent users from seeing macro code

I have a macro that I would like to allow users to run but I don't want them to be able to access or see the code. I just want something like a command button that they can click but not be able to see the code behind it.  Of course though, I would need to be able to see it and access it for modifications.  Any way to hide macros and only allow access to them by entering a password or something along those lines?  Thanks.
dbfromnewjerseyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
One way is to insert a Shape of Form Control Commandbutton to the sheet and assign your code to that shape or commandbutton by right clicking on it --> Assign Macros.

Now on VBA Editor --> Tools --> VBA Project Properties --> Protection Tab --> Check the box for Lock project for viewing and set the password as per your choice --> OK.

This way if a user wants to see the VBA code, user will be required to provide the password to see the code or to modify it.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Martin LissOlder than dirtCommented:
Be aware however that a determined can find ways to break the protection.
0
ProfessorJimJamCommented:
I have seen many protection softwares but many of them are penetrable, what i have found unbeatable so far is the http://www.spreadsheet1.com/unviewable-vba-project-app-for-excel.html   Unviewable ++ so far i have not seen a software than can break into unviewable protection.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.