how disable macro that uses FnSetForegroundWindow

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top