Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Forcing a break in VBA if stuck in a continuous loop

This is a discussion on Forcing a break in VBA if stuck in a continuous loop within the Excel Questions forums, part of the Question Forums category; I think the title is self explanatory. I have a macro running which I was doing step by step using ...

  1. #1
    Board Regular
    Join Date
    Apr 2006
    Location
    Phoenix, AZ
    Posts
    78

    Unhappy Forcing a break in VBA if stuck in a continuous loop

    I think the title is self explanatory. I have a macro running which I was doing step by step using F8. The sand dial is on my cursor because the macro is just running away. How can I force it to stop. Idiot me did not save before running and I dont want to lose what I just wrote.

  2. #2
    Banned
    Join Date
    Jul 2006
    Location
    Northeast Pennsylvania
    Posts
    3,656

    Default Re: Forcing a break in VBA if stuck in a continuous loop

    JetEscamilla,

    Try:
    Press and hold down the "CTRL" key, and press the "Break" (Pause) key.


    Have a great day,
    Stan

  3. #3
    Board Regular Norie's Avatar
    Join Date
    Apr 2004
    Location
    Stirling
    Posts
    65,650

    Default Re: Forcing a break in VBA if stuck in a continuous loop

    Well you can stop code with CTRL+BREAK.

    But it's probably a good idea to investigate why the code is 'running away'.
    If posting code please use code tags.

  4. #4
    Board Regular
    Join Date
    Nov 2007
    Location
    Chicago, IL
    Posts
    1,161

    Default Re: Forcing a break in VBA if stuck in a continuous loop

    I think Ctrl + break will stop VBA from running.

    HTH
    Roger

  5. #5
    Board Regular
    Join Date
    Apr 2006
    Location
    Phoenix, AZ
    Posts
    78

    Angry Re: Forcing a break in VBA if stuck in a continuous loop

    Thanks for the responses

    ctrl+break is not working for me. The sand dial stays on my cursor and will not let me click anywhere on the VBA window. It may be that excel just bugged out on me and not stuck in a loop. Any other ideals.

  6. #6
    MrExcel MVP Jonmo1's Avatar
    Join Date
    Oct 2006
    Location
    Bryan, TX
    Posts
    31,927

    Default Re: Forcing a break in VBA if stuck in a continuous loop

    You won't like this idea....

    go get lunch, and wait for it to stop...

    Otherwise, CTRL + ALT + DEL - end process
    Want better/faster responses to your questions?
    Use Excel Jeanie to post samples of your sheet.

    The more we learn, and the better we get at our trade, the easier it becomes to overlook the obvious.

    Life moves pretty fast. If you don't stop and look around once in a while, you could miss it.
    Ferris Bueller A.K.A. John Hughes, 1986

  7. #7
    Board Regular
    Join Date
    Apr 2006
    Location
    Phoenix, AZ
    Posts
    78

    Unhappy Re: Forcing a break in VBA if stuck in a continuous loop

    Well I had to Ctrl+Alt+Del it. Auto recover picked it up from an hour ago. Not too much was lost. Still frustrating, but I guess it could have been worse. Thanks for the replies everyone.

  8. #8
    Board Regular Hoozits's Avatar
    Join Date
    May 2005
    Location
    Illinois
    Posts
    241

    Default Re: Forcing a break in VBA if stuck in a continuous loop

    What if you don't have a pause/break key on your computer?
    Using Windows XP

    "The reasonable man adapts himself to the world: the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man."

    George Bernard Shaw

  9. #9
    VoG
    VoG is online now
    MrExcel MVP
    Moderator
    VoG's Avatar
    Join Date
    Jun 2002
    Location
    127.0.0.1
    Posts
    62,277

    Default Re: Forcing a break in VBA if stuck in a continuous loop

    You can keep tapping ESC but in my experience that often doesn't work.
    HTH, Peter
    Please test any code on a copy of your workbook.

  10. #10
    Board Regular Hoozits's Avatar
    Join Date
    May 2005
    Location
    Illinois
    Posts
    241

    Default Re: Forcing a break in VBA if stuck in a continuous loop

    That was my experience as well. I guess I need to be more careful in future. Thanks for the reply.
    Using Windows XP

    "The reasonable man adapts himself to the world: the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man."

    George Bernard Shaw

Page 1 of 2 12 LastLast

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


DMCA.com