ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Restricting Macros (https://www.excelbanter.com/excel-programming/320986-restricting-macros.html)

Ed

Restricting Macros
 
I have a program that uses VBA modules and macros. I've password protected
the VBA. How do I restrict the running of the macros from the Tools, Macros
menu? Edit and Delete are restricted but not Run. Thank you.
--
Ed

Fredrik Wahlgren

Restricting Macros
 

"Ed" wrote in message
...
I have a program that uses VBA modules and macros. I've password

protected
the VBA. How do I restrict the running of the macros from the Tools,

Macros
menu? Edit and Delete are restricted but not Run. Thank you.
--
Ed


Have you tried the Application.Caller method? It should tell you how the
macro was called. I guess it should be possible to figure out whether it was
was called from the Tools|Macros menu item.

/Fredrik



Bob Phillips[_6_]

Restricting Macros
 
Add this to the module at the start

Option Private Module

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Ed" wrote in message
...
I have a program that uses VBA modules and macros. I've password

protected
the VBA. How do I restrict the running of the macros from the Tools,

Macros
menu? Edit and Delete are restricted but not Run. Thank you.
--
Ed




Ed

Restricting Macros
 
This fixed the problem; thank you.

"Bob Phillips" wrote:

Add this to the module at the start

Option Private Module

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Ed" wrote in message
...
I have a program that uses VBA modules and macros. I've password

protected
the VBA. How do I restrict the running of the macros from the Tools,

Macros
menu? Edit and Delete are restricted but not Run. Thank you.
--
Ed





Ed

Restricting Macros
 
I needed to use Option Private Module. But your reply introduced another
method to me; thank you.

"Fredrik Wahlgren" wrote:


"Ed" wrote in message
...
I have a program that uses VBA modules and macros. I've password

protected
the VBA. How do I restrict the running of the macros from the Tools,

Macros
menu? Edit and Delete are restricted but not Run. Thank you.
--
Ed


Have you tried the Application.Caller method? It should tell you how the
macro was called. I guess it should be possible to figure out whether it was
was called from the Tools|Macros menu item.

/Fredrik





All times are GMT +1. The time now is 10:34 AM.

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