View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default how to get onkey macro to fire while another macro is running

I think you would need to subclass Excel and or hook into the keyboard
buffer. See this thread by Stratos

http://groups.google.com/groups?thre...9237C%40iti.gr

for some ideas.



--
Regards,
Tom Ogilvy

"Brian Murphy" wrote in message
...
Hello to all you Excel Wizards,

I have a macro that does some quick and dirty animation with an embedded
chart (I just use a simple loop, and the Escape key to halt). I'm pretty
happy with how the animation works but I'd like to enable some keypress
commands to control the animation, and excel does not respond to keystrokes
while my animation macro is running. This behavior actually makes some
sense since you can't click on cells or do anything else while the animation
macro is running. I use Application.EnableCancelKey to respond to a press
of the Escape key. But Application.OnKey does not work for other keys.

Is there any way to allow my animation macro to respond to presses of other
keys besides Escape?

I might point out that I have successfully worked out using mouse movements
to control the animation stream. If the mouse isn't moving, the animation
plays normally. If the mouse is moved to the right(or left) the animation
plays forward (or backward) as long as the mouse keeps moving. Otherwise it
starts to play normally again. I'm using the API call GetCursorPos to do
this. This is pretty cool. At least to me.

Anyway, responding to some other keystrokes would be nice. I hope it can be
done without diving into classes and events, which I suppose is possible
since the animation is being done with a single excel chart.

Thanks,

Brian Murphy
Austin, Texas