Re: Long processess and responsiveness



On Sun, 2 Mar 2008 14:04:20 -0800 (PST), Oddball <oddball.bfi@xxxxxxxxx> wrote:

Couple of questions for a C#er moving into the world of VBA (I'm done
with the swearing and the 'what do you mean it can't' moments, you
work with what you're given! Still, doesn't mean I have to like it,
eh)

I'm working in Excel here - 2003 mostly

1) My IDE has a Pause button on it - but when I run something
complicated it locks up both Excel and the IDE. Why do I have a pause
button? Is there some way I can detatch my IDE from the VBA execution
and keep it responsive?

2) If I am doing a long process (and the processes I've been brought
onboard to manage are long, boring and mostly repetative - why can't I
use C#? Group said no - VBA only) can I make it occasionaly display a
"This process is taking a long time - do you wish to terminate this
process?" window which doesn't block the thread execution (so it
doesn't matter if you've gone to the toilet).

I think I know the answer to both of these questions, I think it's
rather short and begins with n. I have already cried my last tear of
frustration, it can't get worse.

--> Josh

Unless the process is well and truly horked, you should be able to break
execution at any time by pressing Ctrl+Break on the keyboard. That should stop
VBA in its tracks and bring up the VBA Editor with the currently executing line
highlighted in yellow. You can look at variable values (hover over the
variable's name anywhere in the code; but doesn't work for objects or arrays),
open the Locals or Watch window, etc. Then press F8 to single-step or F5 to
resume regular execution.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit.
.