Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Avoiding macro run for terminating by user


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.


--
escelinen
------------------------------------------------------------------------
escelinen's Profile: http://www.excelforum.com/member.php...o&userid=27966
View this thread: http://www.excelforum.com/showthread...hreadid=474662

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Avoiding macro run for terminating by user

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...b;en-us;213509

--


Gary


"escelinen" wrote
in message ...

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.


--
escelinen
------------------------------------------------------------------------
escelinen's Profile:
http://www.excelforum.com/member.php...o&userid=27966
View this thread: http://www.excelforum.com/showthread...hreadid=474662



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Avoiding macro run for terminating by user

Hi Escelinen,

See the EnableCancelKey property in VBA help.

For example:

Application.EnableCancelKey = xlDisabled


---
Regards,
Norman



"escelinen" wrote
in message ...

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.


--
escelinen
------------------------------------------------------------------------
escelinen's Profile:
http://www.excelforum.com/member.php...o&userid=27966
View this thread: http://www.excelforum.com/showthread...hreadid=474662



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Avoiding the worksheet specific name in a macro Jeff Modares Excel Discussion (Misc queries) 2 September 23rd 09 07:57 PM
Can you terminate an autorecover save operation w/o terminating EX gcanty Excel Discussion (Misc queries) 1 June 18th 08 09:08 PM
Mysteriously terminating code [email protected] Excel Programming 6 August 2nd 05 03:22 PM
Macro avoiding circular reference Kanga 85 Excel Worksheet Functions 3 June 15th 05 03:04 AM
Terminating Forms S. L. S. Excel Programming 1 April 21st 05 10:50 PM


All times are GMT +1. The time now is 01:11 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"