Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Howdie All, I have a workbook with many macros in, some I use for design, and would not like users to be able to run them, (which they can currently easily do by selecting Tools...macro...run...) So the question is, can I protect some macros from being run? Regards D *** Sent via Developersdex http://www.developersdex.com *** |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You can use the Private keyword with your macro to prevent it from
showing in the list of macros, such as Private Sub Macro1() |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Darin,
you can also use useless optional parameter: Sub macro1(optional useless as variant) macro1 will not be visible to the user in macrorun, but you will not have any problems in your code with this useless parameter (maybe you could have problems with making the sub private). Regards, Ivan |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Darin: This will prevent the user from accessing the macro from the Tools menu. Sub macro1_(Optional_HideRoutine_As_Integer)_ Brian M. -- Brian Matlack ------------------------------------------------------------------------ Brian Matlack's Profile: http://www.excelforum.com/member.php...fo&userid=3508 View this thread: http://www.excelforum.com/showthread...hreadid=540314 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If you put
Option Private Module as the first line of code in your code module, none of the macros in that module will be listed in the Macro Dialog. If, however, the user knows the name of the macro, he can type it in the dialog and get it to run. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Darin Kramer" wrote in message ... Howdie All, I have a workbook with many macros in, some I use for design, and would not like users to be able to run them, (which they can currently easily do by selecting Tools...macro...run...) So the question is, can I protect some macros from being run? Regards D *** Sent via Developersdex http://www.developersdex.com *** |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks all for your feedback!!
Regards Darin *** Sent via Developersdex http://www.developersdex.com *** |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Protect macro | Excel Discussion (Misc queries) | |||
protect a macro | Excel Programming | |||
Protect Macro | Excel Programming | |||
protect a macro | Excel Programming | |||
protect - macro? | Excel Programming |