Ctrl-Breaking out of function leaves #VALUE wont go away


Posted by Steve R on January 15, 2001 3:10 PM

I know I read SOMEWHERE that someone else had this problem but of course that was BEFORE I ran into it myself. My function recalculates the active sheet hundreds of times and I want to have a way to abort, I have trapped the ctrl-break error and handled it but sometimes I get "#VALUE" in some of my UDF cells and pressing F9 to recalculate doesn't fix them. If i select the cell and just press F2, Enter it goes back to normal (gets a value). What is the deal with this?

Posted by Thomas Venn on January 16, 2001 4:48 PM

Control+Alt+F9 all at the same time may help.

Cheers,

- Thomas



Posted by Steve R on January 17, 2001 12:30 PM

Thanks... that does the trick -- wish I could figure out WHY its doing that, though. Seems that its not possible to get Excel to handle the ctrl-break event in this kind of situation... 99% of the time when I press Ctrl-Break excel is on the "Function blahblah()" line of code so it doesn't know what to do... that is the case where it returns #VALUE and then continues on with my recalculation code. Oh well, looks like the end user may have to deal with Excel's built-in ctrl-break event handling... UGLY.