I
Ian Elliott
Thanks in advance for any help.
I have a macro that controls another application by using the function
FnSetForegroundWindow and also FnFindWindowLike, and then sending keys to it.
It seems I have a very hard time canceling my macro. I think it has something
to do with these functions I mentioned. I have a:
On Error GoTo handleCancel
Application.EnableCancelKey = xlErrorHandler
and a section for that:
handleCancel:
If Err = 18 Then
MsgBox "You cancelled"
End If
But this doesn't help. Does anyone have an idea on how I can stop my program
easily? It is a little long (30 seconds-1 minute) and I don't want the user
frustrated. And it might mess up there program if they can't stop it.
thanks again
I have a macro that controls another application by using the function
FnSetForegroundWindow and also FnFindWindowLike, and then sending keys to it.
It seems I have a very hard time canceling my macro. I think it has something
to do with these functions I mentioned. I have a:
On Error GoTo handleCancel
Application.EnableCancelKey = xlErrorHandler
and a section for that:
handleCancel:
If Err = 18 Then
MsgBox "You cancelled"
End If
But this doesn't help. Does anyone have an idea on how I can stop my program
easily? It is a little long (30 seconds-1 minute) and I don't want the user
frustrated. And it might mess up there program if they can't stop it.
thanks again