943,600 Members | Top Members by Rank

Sep 6th, 2009
0

Excel 2007 - infinite code loop

Expand Post »
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?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Mr. Blank is offline Offline
7 posts
since Aug 2009
Sep 7th, 2009
0

Re: Excel 2007 - infinite code loop

Disable Macros security setting when you load Excel? That should enable you to get to the code & correct it.
Sponsor
Reputation Points: 47
Solved Threads: 144
Posting Virtuoso
Suspishio is offline Offline
1,729 posts
since Aug 2007
Sep 8th, 2009
0

Re: Excel 2007 - infinite code loop

Macro security was disabled, but i couldn't get to the code or do anything while the code was running.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Mr. Blank is offline Offline
7 posts
since Aug 2009
Sep 8th, 2009
0

Re: Excel 2007 - infinite code loop

Click to Expand / Collapse  Quote originally posted by Mr. Blank ...
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?
Last edited by Suspishio; Sep 8th, 2009 at 7:36 am. Reason: Omission
Sponsor
Reputation Points: 47
Solved Threads: 144
Posting Virtuoso
Suspishio is offline Offline
1,729 posts
since Aug 2007
Sep 8th, 2009
0

Re: Excel 2007 - infinite code loop

Click to Expand / Collapse  Quote originally posted by Suspishio ...
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
Last edited by Mr. Blank; Sep 8th, 2009 at 9:02 am. Reason: note
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Mr. Blank is offline Offline
7 posts
since Aug 2009
Sep 8th, 2009
0

Re: Excel 2007 - infinite code loop

You're welcome. Then mark the thread as SOLVED.

Cheers
Sponsor
Reputation Points: 47
Solved Threads: 144
Posting Virtuoso
Suspishio is offline Offline
1,729 posts
since Aug 2007
Dec 10th, 2009
0
Re: Excel 2007 - infinite code loop
1
Last edited by tipsen; Dec 10th, 2009 at 12:19 pm.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
tipsen is offline Offline
1 posts
since Dec 2009

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Windows Software Forum Timeline: Internet Explorer 8 Favorites Add to folder
Next Thread in Windows Software Forum Timeline: MSN Messenger sign in problems with XP





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC