Closing a modeless dialog via "esc" key

B

Bob Flanagan

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

Bob
 
P

Peter T

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top