LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jay Jay is offline
external usenet poster
 
Posts: 671
Default EnableCancelKey traps ctrlBreak once, but not twice

Hi - I'm using the following statements (within a procedure) to handle an
interrupt request by the user. It functions properly when the user
interrupts the procedure with the ESCAPE key, but it only functions properly
once if the ctrlBREAK is pressed.

The statements trap and test for Runtime Error = 18 (the errror code for
code interruption). Err=18 both times the ctrlBreak is pressedand the first
time the error is handled properly, but the second time the Excel and the VB
environment (not my error handling statements) stop execution with a "Runtime
Error '18'" dialog with [End] [Debug] buttons.

On Error GoTo userInterrupt
Application.EnableCancelKey=xlErrorHandler
' do stuff here....

userInterrupt:
if err=18 then
' handleerror
resume next
else resume next
end if
end sub
--
Thanks,
Jay
 
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
EnableCancelKey with On Error Resume Next Paul S[_3_] Excel Programming 2 May 1st 04 10:22 AM
Problem w/.EnableCancelKey = xlErrorHandler Nathan Gutman Excel Programming 0 January 16th 04 05:18 PM


All times are GMT +1. The time now is 06:24 AM.

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

About Us

"It's about Microsoft Excel"