ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   disable workbook (https://www.excelbanter.com/excel-programming/418493-disable-workbook.html)

Roxy

disable workbook
 
I would like to not allow a user to open a workbook if she/he does not enable
macros when prompted. Is there a cool way to do this? I have some code in
the Workbook_Open that must run when the workbook is open. Thanks.

JLGWhiz

disable workbook
 
If macros are not enabled, no code runs.

"Roxy" wrote:

I would like to not allow a user to open a workbook if she/he does not enable
macros when prompted. Is there a cool way to do this? I have some code in
the Workbook_Open that must run when the workbook is open. Thanks.


John

disable workbook
 
the common way most deal with this problem is to hide all but one sheet when
saving & closing your workbook. This sheet would be displayed when macro's
are not enabled next time workbook is opened, showing a message informing
user that macro's must be enabled.
If however, macros are enabled then other worksheets are unhidden & message
sheet hidden.
Sounds tad complicated but can be made to work for most uses.
Have a look at this site for some idea how to approach the problem. You can
google other sites for further samples
http://www.dotxls.com/excel-security...e-excel-macros

Hope helpful


--
jb


"Roxy" wrote:

I would like to not allow a user to open a workbook if she/he does not enable
macros when prompted. Is there a cool way to do this? I have some code in
the Workbook_Open that must run when the workbook is open. Thanks.


Alan Moseley

disable workbook
 
Nice answer John! Thinking 'out of the box'.
--
Alan Moseley IT Consultancy
http://www.amitc.co.uk


"john" wrote:

the common way most deal with this problem is to hide all but one sheet when
saving & closing your workbook. This sheet would be displayed when macro's
are not enabled next time workbook is opened, showing a message informing
user that macro's must be enabled.
If however, macros are enabled then other worksheets are unhidden & message
sheet hidden.
Sounds tad complicated but can be made to work for most uses.
Have a look at this site for some idea how to approach the problem. You can
google other sites for further samples
http://www.dotxls.com/excel-security...e-excel-macros

Hope helpful


--
jb


"Roxy" wrote:

I would like to not allow a user to open a workbook if she/he does not enable
macros when prompted. Is there a cool way to do this? I have some code in
the Workbook_Open that must run when the workbook is open. Thanks.



All times are GMT +1. The time now is 02:20 AM.

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