![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Apr 2002
Posts: 177
|
I want to disable someone from pressing CTRL+Break &/or Esc while the macro is running. I tried the following, but the keys still stop the macro while it is running.
Application.OnKey "{ESCAPE}", "" Application.OnKey "^{BREAK}", "" Any clue? |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Denver, Colorado USA
Posts: 4,014
|
Hi cjcobra,
Try Application.EnableCancelKey = xlDisabled but be careful. Disabling cancel is dangerous, especially if there is any possibility of an infinte loop. Make sure your code is thoroughly checked out and tested before setting it.
__________________
Keep Excelling. Damon VBAexpert Excel Consulting (My other life: http://damonostrander.com ) |
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Apr 2002
Posts: 177
|
That worked! I have a countdown that needs to be completed before the next set of code.
Thanks! |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|