Avoiding macro run for terminating by user

  • Thread starter Thread starter escelinen
  • Start date Start date
E

escelinen

Hello,

is it possible to avoid user to terminate macro? If I have quit long
macro running, which is processing several actions in many sheets, I
don't want anybody to terminate macro by pressing *Ctrl-Break*. If that
happens, it would be catastrophic for my workbook to run correctly next
time somebody wants run a macro again. :eek:
 
maybe something like this

' Macro to turn off keyboard entry.
Sub KeyboardOff()
' Sets CTRL+D to activate KeyboardOn.
Application.OnKey "^d", "KeyboardOn"
Application.DataEntryMode = True
End Sub

' Macro to restore keyboard entry.
Sub KeyboardOn()
Application.DataEntryMode = False
End Sub

here's the kb article

http://support.microsoft.com/default.aspx?scid=kb;en-us;213509
 
Hi Escelinen,

See the EnableCancelKey property in VBA help.

For example:

Application.EnableCancelKey = xlDisabled
 

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

Back
Top