View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Question on VBA : how to detect "idle" condition

Daniel,

See the code at http://www.cpearson.com/Excel/TimedClose.htm.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel, 10 Years
Pearson Software Consulting
www.cpearson.com
(email on the web site)


"Daniel" wrote in message
...
Hi everybody,

I have this Excel worksheet, associated with a "Auto Open" macro. After
this macro has performed the few tasks it is designed for, the user is
then free to enter whatever he wants to in the spreadsheet.

I would like to automatically save the worksheet and exit Excel if there
is no activity (i.e. if the user doesn't move the mouse, press a key,
anything...) at a given time, after the macro has done it's job.

Is there a simple way to do this ? For instance, would the solution
consist in detecting that there is not change whatsoever on the Excel
screen and Exit after a counter has elapsed , whilst letting the user
react at any time ?
(sorry about my lousy English, guys).

Could someone suggest a few lines of code I could try ?

Many thanks in advance for your time and kind help.
BRGDS,
Daniel