ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to disable Visual Basic Editor in Excel file (https://www.excelbanter.com/excel-programming/296027-how-disable-visual-basic-editor-excel-file.html)

No Name

How to disable Visual Basic Editor in Excel file
 
Hello,
Can someone tell me how to disable Visual Basic Editor in
Excel file, I think it would be helpful to avoid users
going into the VB editor enviroment by press Ctrl+Break
accidently.

Thanks very much.

Rgds
Shu

AA2e72E[_2_]

How to disable Visual Basic Editor in Excel file
 
Insert this line

application.EnableCancelKey =xlDisabled

at the start of your code or in the workbook_open event handler

OR

Protect your code with a password.

No Name

How to disable Visual Basic Editor in Excel file
 
Thanks a lot. This works.

Rgds
Shu
-----Original Message-----
Insert this line:

application.EnableCancelKey =xlDisabled

at the start of your code or in the workbook_open event

handler.

OR:

Protect your code with a password.
.



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

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