ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   forcing 'macro enable' on open (https://www.excelbanter.com/excel-programming/302124-forcing-macro-enable-open.html)

i-Zapp[_3_]

forcing 'macro enable' on open
 
Is there a way to essential "force" a user to enable macros by eithe
giving him the choice to enable, or if he doesnt then the workbook i
forced to close?

In other words, a user cannot edit the workbook without allowing macro
enabled.

I know that if the wb contains XL4.0 macros and the security level i
set to high, then this exact scenario exists... but i cannot ensure th
user's Excel security level is set to High

--
Message posted from http://www.ExcelForum.com


Bernie Deitrick

forcing 'macro enable' on open
 
No, you can't truly force a user to do anything. One possible way that will
work with less sophisticated users is to hide all but the sheets except one,
and on that sheet have a message "Hey, only open this workbook with the
macros enabled."

Then use the workbook open event to hide that 'message' sheet and unhide the
others. Password protect everything, including sheets, workbook, and VBA
project, so if they open the workbook with macros enabled, they get to see
the sheets, otherwise, they only get the message sheet.

HTH,
Bernie
MS Excel MVP

"i-Zapp " wrote in message
...
Is there a way to essential "force" a user to enable macros by either
giving him the choice to enable, or if he doesnt then the workbook is
forced to close?

In other words, a user cannot edit the workbook without allowing macros
enabled.

I know that if the wb contains XL4.0 macros and the security level is
set to high, then this exact scenario exists... but i cannot ensure the
user's Excel security level is set to High.


---
Message posted from http://www.ExcelForum.com/




Mike Fogleman

forcing 'macro enable' on open
 
You can't force a user to enable macros, that would defeat the security
settings. And if macros are disabled, then you can't force the wb to close.
What you can do is create a sheet with a statement on it something like "You
must enable macros to use this Workbook. Close the Workbook and re-open with
macros enabled." In the Private Sub WorkBook_Open() of ThisWorkbook, Hide
this sheet and Unhide all the other sheets. In the Private Sub
WorkBook_Close() of ThisWorkbook, Hide all the other sheets and unhide this
one. This will make only the warning sheet visible when the book is closed.
If it is opened with macros disabled, then the WorkBokk_Open cannot run and
all they can do is read the warning sheet.

Mike F

"i-Zapp " wrote in message
...
Is there a way to essential "force" a user to enable macros by either
giving him the choice to enable, or if he doesnt then the workbook is
forced to close?

In other words, a user cannot edit the workbook without allowing macros
enabled.

I know that if the wb contains XL4.0 macros and the security level is
set to high, then this exact scenario exists... but i cannot ensure the
user's Excel security level is set to High.


---
Message posted from http://www.ExcelForum.com/





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

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