Prevent Excel VBA code interruption with Esc key -
how can prevent excel vba code being interrupted user pressing esc
key?
i'm trying following code on thisworkbook
:
private sub workbook_open() on error resume next application.enablecancelkey = xldisabled application.dataentrymode = true call webpage end sub
but it's not working since if press esc when workbook opens, code breaks:
so seems code interrupted before workbook opens. there way fix this?
thanks helping!
it seems workbook big enough there time delay between opening , running code, leaving opportunity user hit esc in meantime. perhaps instead of calling webpage on workbook opening, have file 'landing page' instructions , single button click. gives user control on executing macro, gives time load disabling of escape key before macro run.
also, if have confidence error handling return functionality normal use instead:
application.interactive = false
this prevent key instructions being entered, including esc & command break.
Comments
Post a Comment