How to stop a macro from running?

  • I've a macro which opens a page and highlights the search box. I want to stop the macro, if the user doesnt give input within 10 sec. How can I accomplish this? Thanks.

  • I guess you know the Internet Explorer (IE) Object model since you probably used it to open the site and set the focus. As such, I would use Timer(). A loop would execute until Timer-StartTime>=10. Or, use the Application.OnTime method and then check the Element's value or current site's URL to match to the first one.


    The easier thing might be to do it in a Userform or such and then do the IE thing.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!