I'm glad you found another use for it Greg. It goes to show that the rapid
polling concept can be used to plug all sorts of gaps in Excel's object model.
I particularly like it when used in conjunction with GetCursorPos and
RangeFromPoint, providing us with all those mouse movement type events that
many of us have longed for. I hazard a guess that throwing GetAsyncKeystate
into the mix could provide mouse button events too. RangeFromPoint can
return ChartObjects too, so using it in conjunction with the GetChartElement
method could produce some really cool chart effects.
I adapted the code from the following post by Jaafar,
http://groups.google.com.au/group/m...ogramming/browse_frm/thread/372b44f8ee8e8937/
In that example, the same concept is used to monitor MouseEnter and
MouseExit events at a cell based level.
Do you know if there is a performance problem when it is running with large
projects or other issues?
In my experimentations I've seen Excel crash a couple of times (I'm not sure
why), and as you noticed, MsgBoxes pose a bit of a problem. Best practice
would be to stop the timer before running any other code, then start the
timer again when the other code is finished. Typically though, once the code
is fully debugged it seems to chug along quite happily. I would still
recommend using it as sparingly and as carefully as possible.
Regards,
Vic Eldridge