ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Esc Key Closes Workbook (https://www.excelbanter.com/excel-programming/358974-esc-key-closes-workbook.html)

MSweetG222

Esc Key Closes Workbook
 
All,

I am running a VBA program (via an add-in). The program is running with
ScreenUpdating set to False, so I have a Progress Bar User Form displayed
indicating program progress.

Issue: If User hits the Esc Key - the Active Workbook closes, without
warning, etc.

Question #1: Is that the normal function of the Esc Key?
Question #2: What can I do to prevent this type of action?

Thx
MSweetG222


Tom Ogilvy

Esc Key Closes Workbook
 
If you set the cancel property of a commandbutton to True, then hitting the
escape key will fire the click event of that button. Is there a cancel
button on the userform that causes the same behavior. If so, and you can
get into the Add-In, change the property to false.

I would say that closing the workbook is not a typical function of the Esc
key - although it might be if were on a useform used to challenge access to
a workbook by prompting for a password.

--
Regards,
Tom Ogilvy


"MSweetG222" wrote in message
...
All,

I am running a VBA program (via an add-in). The program is running with
ScreenUpdating set to False, so I have a Progress Bar User Form displayed
indicating program progress.

Issue: If User hits the Esc Key - the Active Workbook closes, without
warning, etc.

Question #1: Is that the normal function of the Esc Key?
Question #2: What can I do to prevent this type of action?

Thx
MSweetG222





All times are GMT +1. The time now is 04:25 AM.

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