Consulting

Results 1 to 5 of 5

Thread: Solved: Code execution interrupted

  1. #1
    VBAX Regular
    Joined
    Sep 2007
    Location
    Singapore
    Posts
    63

    Solved: Code execution interrupted

    Hi all!

    I've encountered this extremely annoying problem last night. It's as if there was an invisible hand pressing Ctrl + Break all the time while my macro ran. For some weird reasons, the "Code execution has been interrupted" pop-up keeps appearing whenever I run my macros.

    Initially, I thought it was due to errors within my code. However, I checked through the code and found nothing amiss. In fact, the macros ran along fine and achieved the desired output as long as I clicked on the "Continue" button in the pop-up.

    I transferred the Excel file and ran the exact same macro on another computer and it worked fine, i.e. no irritating pop-ups. Thus, I guessed I must have messed up some settings within my copy of Excel on my computer. It'll be great if you guys can help me on this. Thanks!

  2. #2
    VBAX Master TonyJollans's Avatar
    Joined
    May 2004
    Location
    Norfolk, England
    Posts
    2,291
    Location
    It is extremely annoying, isn't it! I have been trying to find out about this for some time and I'm sorry to say I have no answers for you.

    It seems as if some code or some activity triggers the situation but, once triggered it won't go away. I *think* that closing all office applications and reopening them clears it - certainly rebooting does. But, of course, whatever the trigger is, it can re-occur.

    I have had it recently running Office 2007 under Vista - but once it has been triggered it can happen in app in any office version (I have 2002 and 2003 as well as 2007 on the one machine). I remember it once before on a different machine running, I think, Office 2003 under XP Pro - certainly pre-dating Vista. I think it tends to happen when Windows has been running for a few days but I am far from sure of that.

    Any further information or observations you can provide would be very helpful. I remain as mystified and frustrated as you!!
    Enjoy,
    Tony

    ---------------------------------------------------------------
    Give a man a fish and he'll eat for a day.
    Teach him how to fish and he'll sit in a boat and drink beer all day.

    I'm (slowly) building my own site: www.WordArticles.com

  3. #3
    VBAX Regular
    Joined
    Sep 2007
    Location
    Singapore
    Posts
    63
    Hi Tony,

    Thanks for the reply. I did try closing all office applications and opening them again but it doesn't work. What did the trick for me was - as you suggested - a reboot. When my system boots up, the invisible hand has disappeared totally and my macros ran without those pop-ups appearing repeatedly.

    Oh, by the way, the problem occured after I dropped my mouse accidentally on the floor. As I fumbled with the mouse cable, I pressed the mouse buttons a couple of times. That led to my earlier assumption that I could have messed up some settings through the random presses.

    Besides those irritating pop-ups, I also noticed that the Properties windows in VBE was grayed out, as if it was disabled. However, I could still make changes, e.g. setting a command button's visibility to false or changing an option button's value to true, etc.

    Anyway, now that the problem is gone, I do hope it doesn't come back again, either by chance or through my actions.

  4. #4
    VBAX Master TonyJollans's Avatar
    Joined
    May 2004
    Location
    Norfolk, England
    Posts
    2,291
    Location
    I can't say I've seen any symptoms like that - but I have a cordless mouse

    If you ever do find out anything I would be very pleased to hear about it.
    Enjoy,
    Tony

    ---------------------------------------------------------------
    Give a man a fish and he'll eat for a day.
    Teach him how to fish and he'll sit in a boat and drink beer all day.

    I'm (slowly) building my own site: www.WordArticles.com

  5. #5
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Hi Tony,
    Re Code Interrupted I came across this. Just tried it and it seems to work!
    Regards
    Malcolm

    [VBA]
    Application.EnableCancelKey = xlDisabled
    [/VBA]
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

Posting Permissions

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