Can't enter break mode at this time ERROR

A

Ayo

How do I bypass the "Can't enter break mode at this time" error. I am trying
to find the source of the problem in my code but when this message comes up I
on't have the option to Debug. I only have options to Continue, End and Help.
How do I get in the Debug mode to try and fix my code problem?
Thanks
 
J

Joel

There are certain instructions in VBA that will produce this warning message.
You can't eliminate this message. You either have to put break points
futher in the code past these instructions. If you are stepping through the
code you have to add a break point futher in the code and then press F5 to go
to break point. What also helps is adding debug.print statments to see what
is happening in the areas that you can't sterp through your code.
 
A

Ayo

The problem is, no matter where I put the break point, I get the error
message. It is not allowing me to debug my code.
 
J

Joel

I usually end up adding msgboxes to the code as a last resort when it doesn't
let me use beak points. Sometimes I comment out the instruction that is
preventing the break point. then add it back in after the rest of the code
is working.
 
A

Ayo

Thanks Joel. I think I have found a way around my problem. The offending code
lines are:
Worksheets("FC Construction").Delete
Windows("FC CONSTRUCTION TRACKER_V2.xls").Activate
Sheets("FC Construction").Select
Sheets("FC Construction").Copy
After:=Workbooks("DailyStatus.xls").Sheets("Dates")
So I commented out the first line and now I am able to debug the codes.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top