"Code Execution has been interrupted" Message

Philaz

New Member
Joined
Jan 9, 2014
Messages
22
I have read all the threads on this issue but my situation seems a little different so I thought I would post it.
I have 4 macros (call them A,B,C,D). They were all running fine. Recently I started getting the Code Execution message. All the messages were pointing to ghost breakpoints that I had previously used during testing. I tried all the recommended methods to fix the problem but nothing worked. So this is what I found.
I have 4 different versions of a database on my desktop (call them (1,2,3,4). Database 1 only contains macro A. The other 3 databases contain all 4 macros. When I was investigating the problem, I never had more than 1 database open at a time. When I was testing 2,3,4 I would get the Code Execution message and F5 would allow me to continue. However, when I tested db 1 (which I hadn't touched for weeks) I got the Code Execution message but when I pressed F5 I got a message that said the action couldn't be completed because the sheet was protected. I unprotected the sheet in 1 (sheets were not protected in db 2,3,4) and wala all the problems went away and everything runs fine in all the db.
So every thing is fine now but maybe somebody can explain why to me.:confused:
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
If the macro is trying to make changes to protected sheets it will fail because of the protection. So you basically can't do that without unprotecting the sheets first. There is only one recommended method for fixing "ghost breakpoints". Delete the line of code and type it back in.

ξ
 
Upvote 0
But I wasn't running the macro that was causing the problem. I was running other macros that had no connections to the offending macro. That is the part I don't understand.
 
Upvote 0
Hi, sorry. I'm not sure I follow. If you aren't running a macro then it cannot crash. The problem cannot be in a macro that isn't running.
 
Upvote 0
But that is exactly what seems to happen. Let me clarify. I am in a db that has all 4 macros stored. Macro 1 is the offending macro. I try to run macro 2 and I get the code execution message that points to a ghost breakpoint. I delete the line and retype it and still get the message. One thing I didn't mention is that the vba editor is open and all the macros are in view code mode (don't know if that makes any difference). When I discovered that macro 1 had a problem I fixed the code then went back and ran macro 2 and it ran fine. All the ghosts were gone from macros 2,3,4 and they ran fine. I am wondering if is possible that macro 1hadbeen in break mode all along but I don't think so because I had quit and restarted the db.
 
Upvote 0

Forum statistics

Threads
1,214,651
Messages
6,120,744
Members
448,989
Latest member
mariah3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top