Results 1 to 6 of 6
  1. #1
    5 Star Lounger
    Join Date
    Apr 2001
    Location
    Arriving Somewhere but not Here
    Posts
    698
    Thanks
    0
    Thanked 0 Times in 0 Posts

    code execution has been interrupted (XL97 sr2 on W

    Any ideas why some code I have that worked fine the other day should now keep stopping with 'code execution has been interrupted'? The help dialog implies the code has received a 'ctrl break' or an 'esc' but I haven't pressed anything! Choosing continue makes it go again but it stops several more times before the code ends. Choosing debug reveals that the code does not always stop at the same points either.

    The same code still works fine on another PC so the problem seems to be related to my box. I have removed several add-ins I had loaded but no change.

    To add to the weirdness I have a tiny bit of code that sets the File New dialog to default to list mode. This too is giving the same error. Choosing debug shows it's waiting at the End Sub line.

    I fear something somewhere has become corrupt but at the moment I'm....

    stuck

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: code execution has been interrupted (XL97 sr2 on W

    Does the problem persist after rebooting your PC?

    Over time, code modules gather lint and fluff. In the end, this may have a negative effect on performance. Then, it's time to clean your code. Excel MVP Rob Bovey has an excellent free code cleaner. Go to his website, click on Free Utilities and then on VBA Code Cleaner.

  3. #3
    5 Star Lounger
    Join Date
    Apr 2001
    Location
    Arriving Somewhere but not Here
    Posts
    698
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: code execution has been interrupted (XL97 sr2 on W

    I rebooted just after I posted and yes, that has cleared the problem looks like something was twisted somewhere deep in the machine.

    I've seem recommendations for Rob's code cleaner here before, time to check it out. Meanwhile how can code that has not been edited, just used, 'gather lint and fluff' as you so delicately put it?,

    stuck

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: code execution has been interrupted (XL97 sr2 on W

    Well, in fact the "lint and fluff" builds up during repeated editing. It is unlikely that something happens to modules if you only use the code. Unless you're Mad Tom Rackham, of course. That can have an unexpected effect on code. Arr!

  5. #5
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: code execution has been interrupted (XL97 sr2 on W

    Have you tried a different keyboard on the system? It sounds like the keyboard could be generating false keypresses.
    Legare Coleman

  6. #6
    5 Star Lounger
    Join Date
    Apr 2001
    Location
    Arriving Somewhere but not Here
    Posts
    698
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: code execution has been interrupted (XL97 sr2 on W

    That's what I thought, hence my confusion. I hadn't messed with the code for a few weeks but I had loaded some extra add-ins. Removing them didn't seem to fix it yesterday. I'll add them back one at a time and check the macro each time to see if they were part of the problem.

    Legare's suggestion, below, of a keyboard fault is an outside possibility (it could be a feather in the keyboard as I seem to remember answering 'tasty' to the question about parrots <img src=/S/evilgrin.gif border=0 alt=evilgrin width=15 height=15>) but I only saw the effect with two Excel macros, there was no problem with any other application.

    As reported yesterday a reboot made it go away and it's still OK this morning. XL does seems slow to start at the moment, time to go through Jan Karel's startup checks methinks.

    Thanks again.

    stuck

Posting Permissions

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