Hide Macro from View Q

  • Thread starter Thread starter Sean
  • Start date Start date
S

Sean

I have some code that I use in developing sheets, things like
"unprotect all" sheets etc, standard stuff that I like to keepwithin
sheets. Problem with this is that a User with a small bit of knowledge
can simply go to Tool-Macro and run the "unprotect all" code, which
can free up a lot. Is there any simple way around this, apart from
removing the macro itself?

Thanks
 
Sean

Make the Subs Private to prevent users from seeing them in Tools>Macro

In addition you could protect the VBA Project.

Select the project and right-click>vbaproject properties>protection>lock for
viewing.

Provide a password and save.re-open the workbook.

Alternative...............place all your macros into a new workbook then save as
an add-in which you load through tools>add-ins.


Gord Dibben MS Excel MVP
 
Thanks Gordon, I have the VBA project password protected already.

Q - Difference between private and Public, what is that? apart from
the fact that the user can't see within Tool-Macro.

How do you make a macro private?
 
You can also add Option Private Module at the top of the module(s). That
will hide the macros from the Tools->Macros dialog.
 
Thanks for jumping in Tim.

Less work than adding Private to each Sub which would be the answer to

How do you make "a" macro private?


Gord
 
Classic guys, thanks, I always thought that code within the sheet and
not a standard module was "Private" - thanks
 

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

Back
Top