Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 129
Default Is there a reset shortcut

Is there a shortcut for resetting a running application.

Grabbing the mouse then going to Run-Reset seems like a cludge. Like
there's a better way.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 219
Default Is there a reset shortcut

Putting this code in your procedure will allow you to test for the cancel
key. This is an example that I basically got from Dick Kusleika's website
'Daily Dose of Excel' (http://www.dicks-blog.com/)...
Modify as needed.

'/===========================================/
Private Sub ExampleOfHow2HandleTheUserPressingCANCEL()
Dim iTest As Double, iCount As Double
On Error GoTo err_Sub

'xlDisabled = 0 'totally disables Esc / Ctrl-Break / Command-Period
'xlInterrupt = 1 'go to debug
'xlErrorHandler = 2 'go to error handler
'Trappable error is #18
Application.EnableCancelKey = xlErrorHandler


'<<<<<<<<<<<<<<PUT YOUR CODE HERE

exit_Sub:
On Error Resume Next
Exit Sub

err_Sub:
If Err.Number = 18 Then
If MsgBox("You have stopped the process." & vbCr & vbCr & _
"QUIT now?", vbCritical + vbYesNo + vbDefaultButton1, _
"User Interrupt Occured...") = vbNo Then
Resume 'continue on from where error occured
End If
End If

GoTo exit_Sub

End Sub
'/===========================================/


HTH,
--
Gary Brown

If this post was helpful, please click the ''Yes'' button next to ''Was this
Post Helpfull to you?''.


" wrote:

Is there a shortcut for resetting a running application.

Grabbing the mouse then going to Run-Reset seems like a cludge. Like
there's a better way.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 486
Default Is there a reset shortcut

You can use the escape key something like this for interupting a loop...

Private Sub CommandButton1_Click()
Dim lng As Long
On Error GoTo ErrorHandler
Application.EnableCancelKey = xlErrorHandler
For lng = 1 To 1000000

Next lng
Exit Sub
ErrorHandler:
If Err = 18 Then
If MsgBox("Do you want to stop?", vbYesNo, "Quit?") = vbYes Then
Application.StatusBar = False
Application.EnableEvents = True
Application.Calculation = xlCalculationAutomatic
End
Else
Resume
End If
End If
End Sub

--
HTH...

Jim Thomlinson


" wrote:

Is there a shortcut for resetting a running application.

Grabbing the mouse then going to Run-Reset seems like a cludge. Like
there's a better way.


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
shortcut has change or move so this shortcut can not open bakerstreet Excel Worksheet Functions 2 April 2nd 10 01:21 PM
Tab Key reset DKSteph Excel Worksheet Functions 2 March 20th 09 07:20 PM
How do I reset my Control+A keyboard shortcut in Excel? EFXP Excel Discussion (Misc queries) 1 September 4th 06 05:58 AM
reset to zero baldyheed Excel Worksheet Functions 3 October 2nd 05 03:30 AM
reset me cacique[_5_] Excel Programming 1 July 8th 05 02:54 AM


All times are GMT +1. The time now is 09:45 PM.

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"