ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro Window - Prevent 'Run' (https://www.excelbanter.com/excel-programming/388501-macro-window-prevent-run.html)

WCM

Macro Window - Prevent 'Run'
 
Hi ...

I have created an Excel Report Generator that, through a series of 25
macros, manipulates raw data pasted into a specific worksheet. These macros
exist in 5 different Modules.

I have protected the Project so that no one can edit the macros, but the
macros still appear in the Macro Window and a user could still 'Run' any
macro if he chose to (which, potentially, could screw up the report since the
macros need to be run in a specific order).

Other than moving all the macros into ONE Module and making them 'Private
Subs' so that they do not appear in the Macro Window, is there any other way
to prevent a user from running a macro that appears in the Macro Window?

Thanks ...

Bill


Jim Thomlinson

Macro Window - Prevent 'Run'
 
Add "Option Private Module" to the top of each code module.
--
HTH...

Jim Thomlinson


"WCM" wrote:

Hi ...

I have created an Excel Report Generator that, through a series of 25
macros, manipulates raw data pasted into a specific worksheet. These macros
exist in 5 different Modules.

I have protected the Project so that no one can edit the macros, but the
macros still appear in the Macro Window and a user could still 'Run' any
macro if he chose to (which, potentially, could screw up the report since the
macros need to be run in a specific order).

Other than moving all the macros into ONE Module and making them 'Private
Subs' so that they do not appear in the Macro Window, is there any other way
to prevent a user from running a macro that appears in the Macro Window?

Thanks ...

Bill


WCM

Macro Window - Prevent 'Run'
 
Hi Jim ...

That totally rocks...! That is exactly what I was looking for, and I
wouldn't have run across it on my own in a million years.

Thank you...

b.


"Jim Thomlinson" wrote:

Add "Option Private Module" to the top of each code module.
--
HTH...

Jim Thomlinson


"WCM" wrote:

Hi ...

I have created an Excel Report Generator that, through a series of 25
macros, manipulates raw data pasted into a specific worksheet. These macros
exist in 5 different Modules.

I have protected the Project so that no one can edit the macros, but the
macros still appear in the Macro Window and a user could still 'Run' any
macro if he chose to (which, potentially, could screw up the report since the
macros need to be run in a specific order).

Other than moving all the macros into ONE Module and making them 'Private
Subs' so that they do not appear in the Macro Window, is there any other way
to prevent a user from running a macro that appears in the Macro Window?

Thanks ...

Bill



All times are GMT +1. The time now is 06:38 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com