Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel VB error "can't enter break mode at this time" run amok

Status
Not open for further replies.

ArielMalek

Programmer
Jul 11, 2008
3
US
Hello,
I am pressing the metal to get a project out way past deadline on my
Excel 2003 VBA app. I have a routine to programmatically delete and
clear out some text filled ranges and exit but am having problems with
it(not an error-just unmerging a range it shouldn't) so I tried to set some debug break points in the code to find the
problem but I get the above Visual Basic error message which didn't
happen before believe in this routine. And it happened earlier trying
to debug another routine which seemed inappropriate. I also tried to
use the debug.assert method but it was just ignored. Right or wrong it
seems this error message is happening too much without apparent
reason. The help on it reads as follows:

"Can't enter break mode at this time


Break mode is the state in which a program is still running, but its
activity is suspended. This error has the following cause and
solution:


You tried to enter break mode, for example, by pressing CTRL+BREAK
(Windows) or COMMAND+PERIOD (Macintosh), pressing the Break button on
the Standard toolbar or the Debug toolbar, or by executing a
breakpoint in the running code.
A change was made programmatically to the project using the
extensibility (add-in) object model. This prevents the program from
having execution suspended. You can continue running, or end
execution, but can't suspend execution. "


I'm not sure what extensibility object model might be involved, but I
was fairly certain I could get break points to work in the routine
before.
If anyone has any experience or suggestions, it would be much
appreciated as I need to get this demo out pronto and head spinning from long hours and days. Thanks, God bless,
Van
PS I didn't copy code as routine bit lengthy and not sure where problem occuring since can't break in.

 
Does your code play with the VBAProject ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Hi PHV,
Thanks for your reply. Not sure exactly what you mean. Of course it uses and alters objects within the workbook, but there is no code specifically referring to the "VBAProject"
Due to necessity(the mother of invention) of the time constraints, I did find a workaround to isolate and fix the problem which first prompted my query, however another problem has arisen apparently in the same routine and am having the same problem. If you or anyone has any idea how to conquer this obstacle-or any idea of the root problem- would be much appreciated.
Thanks, Van
 
It's difficult without seeing the code but you could try stepping through from the beginning and seeing at what point it won't let you step through any more. If it's too long to step through all the way try setting breakpoints at a few places along the way and finding one that works and progresssing from there.

Enjoy,
Tony

------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.

I'm working (slowly) on my own website
 
Thanks, Tony, appreciate your input. Have a blessed day,Van
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top