PDA

View Full Version : Click End on code break closes excel application



vpager
11-12-2008, 05:50 AM
I am invariably faced with an annoying problem as follows:
Having typed in a piece of code, I run my vba app. If the code breaks, possibly due to syntax, etc., I am presented with the error report dialog asking if I want to End or Debug.
When I click Debug, the offending line is highlighted as usual but everything is locked. I can't move the active line indicator to another line or add a break point or anything.
The only thing I can do is let the code continue (F5 or F8), which simply displays the dialog again.
But then if I click End, the whole Excel application closes.

Obviusly, if I don't want to lose the new code I've added, then it's up to me to make sure I save before running.
But the applicaiton shouldn't be locking up like this and closing when I end the code on a code error break.

Any suggesitons?

RonMcK
11-12-2008, 07:38 AM
vpager,

If this is happening with all of your XL files, I would run a disk scan to look for and fix missing clusters. After that, I would consider reinstalling MS Excel if the problem persists.

If the problem is limited to a single file, or a small number of files, I would create an empty new worksheet file, copy the pieces from the suspect file to the new file, save the new file with a slightly different name, and try running the code.

And, in the future, do a ^S (or alt-F-S or -A) whenever you've added any appreciable amount of code.

Thanks,

vpager
11-12-2008, 09:32 AM
Thanks Ron.
I was pretty sure I may have to do as you suggest. It was just a case of wondering if anyone else had experienced the same problem.

Cheers
Mike