ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Workbook Open - Prevent CTRL Break (https://www.excelbanter.com/excel-programming/308605-workbook-open-prevent-ctrl-break.html)

Richard Buttrey[_5_]

Workbook Open - Prevent CTRL Break
 
I have a workbook in which the Open Event contains code which deals
with prompting the user for a password, and then allowing them to
continue using the workbook assuming the correct password is entered.

How can I prevent the user breaking out of the macro with the CTRL
Break keys?

Are there any dangers inherent in this approach apart from the obvious
one of myself as 'owner' of the workbook not being able to break out
of the code for admin purposes?

Although I've written code for prompting for and changing passwords,
does anyone have or can point me to a URL which has code to do this?
I'd like to compare an alternative approach.

TIA

Richard Buttrey

Dave Peterson[_3_]

Workbook Open - Prevent CTRL Break
 
Take a look at:
Application.EnableCancelKey
in VBA's help.

(if your code runs before the quickest of users!)

Maybe you could have a dummy workbook set this, then open your workbook.

If they cntl-break, then only your dummy workbook is opened.

Richard Buttrey wrote:

I have a workbook in which the Open Event contains code which deals
with prompting the user for a password, and then allowing them to
continue using the workbook assuming the correct password is entered.

How can I prevent the user breaking out of the macro with the CTRL
Break keys?

Are there any dangers inherent in this approach apart from the obvious
one of myself as 'owner' of the workbook not being able to break out
of the code for admin purposes?

Although I've written code for prompting for and changing passwords,
does anyone have or can point me to a URL which has code to do this?
I'd like to compare an alternative approach.

TIA

Richard Buttrey


--

Dave Peterson



All times are GMT +1. The time now is 09:41 PM.

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