ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Closing a modeless dialog via "esc" key (https://www.excelbanter.com/excel-programming/406919-closing-modeless-dialog-via-esc-key.html)

Bob Flanagan[_2_]

Closing a modeless dialog via "esc" key
 
Is it possible to close a modeless dialog via pressing the esc key when the
dialog no longer has the focus?

Bob



Peter T

Closing a modeless dialog via "esc" key
 
Guess you'd need to Hook the keyboard, or maybe as you are only looking for
one particular key, look into RegisterHotKey. It would make a difference to
the complexity if you need to trap a system-wide keypress or merely in a
given window, say a workbook window.
Plenty of examples around for VB6 but I'm don't know how safe, if at all,
they'd be in VBA.

Regards,
Peter T

"Bob Flanagan" wrote in message
. ..
Is it possible to close a modeless dialog via pressing the esc key when

the
dialog no longer has the focus?

Bob






All times are GMT +1. The time now is 05:31 AM.

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