ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VB code for disabling (https://www.excelbanter.com/excel-programming/281882-vbulletin-code-disabling.html)

DJ

VB code for disabling
 
Is there a way to disable a user's access to the VB code
in an excel workbook?

Is there a way to make the workbook close if the user
options not to enable macros?

Grey_Newt

VB code for disabling
 
In VBA, bring down the tools menu, select Project Properties, click the protection tab, then use the password facility. only special software will crack this password

BrianB

VB code for disabling
 
<<disable a user's access to the VB code in an excel workbook?
Use Tools/VBA Project Properties to set a password.

<<Is there a way to make the workbook close if the user options not to
enable macros?
No - because this would require a macro to run.

The usual method is to hide (and password protect) all the sheets but
one which says something like "Macros must be enabled to use this
workbook." You can then put code in the Workbook_Open() event which
hides this sheet and makes the others visible. If macros are not
enabled, the user cannot get access.

Regards
BrianB
================================================== =======





"DJ" wrote in message ...
Is there a way to disable a user's access to the VB code
in an excel workbook?

Is there a way to make the workbook close if the user
options not to enable macros?



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

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