0

Hi

I'm currently stuck in an infinite loop because of the code I've written and i can't stop the code, close excel etc. Basically the code runs after a cell change, displays a msgbox and then causes itself to run again, and while this is happening i can't do anything except close the msgbox, and then it starts all over again...

So is there a way to stop the code from running or to exit excel without losing recent changes that i have made?

3
Contributors
6
Replies
8
Views
8 Years
Discussion Span
Last Post by tipsen
0

Disable Macros security setting when you load Excel? That should enable you to get to the code & correct it.

0

Macro security was disabled, but i couldn't get to the code or do anything while the code was running.

0

Macro security was disabled, but i couldn't get to the code or do anything while the code was running.

That's srange. When you load excel (blank sheet), you can disable the use of macros. Then when you load your problem spreadsheet, the code should not be running.

Isn't that so?

-----------------------------------
Added: I recently had a simulation running across 7 PCs. It ran for 6 days on each PC and the combined statistics wre gathered and analysed. That's irrelevant! In the early days, I had to interrupt the VBA code and I used Ctrl+Alt+Break. Since you haven't mentioned this, have you tried it?

Edited by Suspishio: Omission

0

That's srange. When you load excel (blank sheet), you can disable the use of macros. Then when you load your problem spreadsheet, the code should not be running.

Isn't that so?

Yeah, sorry that's right...

(The problem doesn't occur when my project loads, but when i was testing my code, and i have since corrected the code anyway)

The problem was that i was editing and testing my code for a project, and then i found myself in an accidental infinite loop which would not let me stop the code, do anything etc... i had done a bit of work which i didn't want to lose and i couldn't find a way to stop the code from running or saving and then closing Excel.

But anyway i had to close it and lost some of the work i had done...(i was saving regularly but didn't foresee this event)

However it would still be good to know if there is a way to get out of an infinite loop if it does ever happen again,(which it has since )

Because in VB6 i think you could pause/stop the code by pressing the pause/break key or the stop button (which in excel it wouldn't let me touch it. and neither did the pause key work).

thanks,


---------------------------------------------------------------
Oh i didn't read what you had added in your previous post.

i will have to try the Ctrl+Alt+Break. EDIT: (I did and it works.)

thanks for your help

Edited by Mr. Blank: note

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.