Long processess and responsiveness

O

Oddball

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
 
J

Jay Freedman

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.
 
O

Oddball

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.

Cheers Jay!

Horked :) I like it - drop a definition and I might use that word :D

At the moment I've got VBA comparing 20000 lines of data against 18000
lines of data. I pointed out that there are better, faster ways that
don't involve me playing Flash games while the thing runs, but they
won't listen.

Ah well, I'm getting payed I guess. It's the inefficiency of it all
that gets me :'(
 
J

Jay Freedman

Cheers Jay!

Horked :) I like it - drop a definition and I might use that word :D

http://en.wiktionary.org/wiki/hork#English --
1. (slang) To foul up; to be broken.
I downloaded the program, but something is horked and it won't load.

http://www.urbandictionary.com/define.php?term=horked
2. computer geek slang for programming code or software that is broken, f-ked
up, corrupted.
Dude, your code totally HORKED the build today.
At the moment I've got VBA comparing 20000 lines of data against 18000
lines of data. I pointed out that there are better, faster ways that
don't involve me playing Flash games while the thing runs, but they
won't listen.

Ah well, I'm getting payed I guess. It's the inefficiency of it all
that gets me :'(

BTDT and got more than a few T shirts. :)

If they have a reason (as opposed to a prejudice), it might be that they don't
want to have to manage both a template and a DLL/assembly. I've seen solutions
like that descend into DLL hell. Since Office is strictly COM-based, .Net
doesn't help much with that.

Consider it job security.
 

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