Get to know if in Break-Mode and/or on what line?

onidarbe

Board Regular
Joined
Mar 22, 2013
Messages
65
Is there a way to know programmatically that we are in BreakMode and maybe even know on what line?

I found out that using apostrophes one can start OnTime with parameters and not having the error "Can't execute code in break mode".
Code:
Application.OnTime now, "'MySub " & now & "'"
This will execute MySub with the time it was started when all running code has finished, not editing a cell or having a MsgBox-popup. But it also executes MySub if the running code has stopped at a break-point. Hard to really debug, because normally the OnTime would wait until all running code has finished.

Knowing the BreakLine would also enable me to have code running in BreakMode and help me writing code with VBProject.VBComponents... ;)
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
sorry, the correct syntax =
Code:
Application.OnTime now, "'MySub """ & now & """'"
Because it isn't a value, it should be within quotes ;)
 
Upvote 0

Forum statistics

Threads
1,214,522
Messages
6,120,020
Members
448,938
Latest member
Aaliya13

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top