View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Chris Chris is offline
external usenet poster
 
Posts: 16
Default abort macro dialog box

Thanks for your verry quick respond.
I found somthing in the helpfile and made som buttons to it.
So this is the code i intergrated in it:

On Error GoTo handleCancel
Application.EnableCancelKey = xlErrorHandler

For X = 1 To 1000000 ' Do something 1,000,000 times (long!)
' do something here
Next X

handleCancel:
If Err = 18 Then
If MsgBox("Do you want to quit?", vbYesNo) = vbYes Then
Exit Sub
Else
Resume
End If
End If


But thing i dont like when i say "NO" He start running the macro from
the beginning, and not from the point i interupt him.
Can this be doen or is that just impossible?