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:

enter image description here

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

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -