Stop a VB program from running

  • Thread starter Thread starter Soterro
  • Start date Start date
S

Soterro

Hello,

If my VB program runs by mistake in an infinite loop, there seems to
be no way to stop it without killing Excel with the TaskManager.
I think there should be a way to just stop whatever the interpreter is
doing. The 'play/stop' toolbar of the VBEditor does not react in any
way when the program is running. Might be important also that the
program is sporting MsgBox'es so it is always waiting for an answer,
and I can't click from the dialog to the stop button in enough time. I
need to stop it _while_ it is waiting for an answer from me.
I'm running Excel 2000 on Windows 2000.

Any ideas appreciated,
S
 
Unless you have disabled the break key, you should be able to use
Ctrl+Break to break stop the code on the current line of
execution. Note that it often takes several Ctrl+Breaks for it to
take.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
I'm using excel 2002 so I'm not sure whether it would
work on 2000, but I just hold down Esc.
 
Soterro said:
Hello,

If my VB program runs by mistake in an infinite loop, there seems to
be no way to stop it without killing Excel with the TaskManager.
I think there should be a way to just stop whatever the interpreter is
doing. The 'play/stop' toolbar of the VBEditor does not react in any
way when the program is running. Might be important also that the
program is sporting MsgBox'es so it is always waiting for an answer,
and I can't click from the dialog to the stop button in enough time. I
need to stop it _while_ it is waiting for an answer from me.
I'm running Excel 2000 on Windows 2000.

Make sure the msgbox has a cancel button and use that to
stop execution

Keith
 
Soterro
On your keyboard, hold down Ctrl and hit Break. Break is near the upper
right corner of your keyboard. Doing this will stop all code. HTH Otto
 
Back
Top