ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Timer for auto shut down (https://www.excelbanter.com/excel-programming/293938-timer-auto-shut-down.html)

Randy[_15_]

Timer for auto shut down
 
Iam using a macro as follows

Sub Timer()
Application.OnTime Now + TimeValue("00:10:00"), "savequit"
end Sub

I auto_open this and was trying to re-activate it with other macros
that are used in the spreadsheet so as long as there was activity the
above timer would be reset to the original TimeValue but it doesn't
work. Is there any way that the above timer can be reset with
different macros or a way to determine if there is no activity after a
predetermined amount of time that the spreadsheet saves itself and
closes the application.

Thank You in Advance
Randy

Tom Ogilvy

Timer for auto shut down
 
See Chip Pearson's page on Application.Ontime for an approach and sample
code:

http://www.cpearson.com/excel/ontime.htm

--
Regards,
Tom Ogilvy

"Randy" wrote in message
om...
Iam using a macro as follows

Sub Timer()
Application.OnTime Now + TimeValue("00:10:00"), "savequit"
end Sub

I auto_open this and was trying to re-activate it with other macros
that are used in the spreadsheet so as long as there was activity the
above timer would be reset to the original TimeValue but it doesn't
work. Is there any way that the above timer can be reset with
different macros or a way to determine if there is no activity after a
predetermined amount of time that the spreadsheet saves itself and
closes the application.

Thank You in Advance
Randy





All times are GMT +1. The time now is 01:57 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com