Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Yes that's possible with code. These get pasted into 'ThisWorkbook' Private Sub Workbook_Open() Call SetDelay End Sub Private Sub Workbook_BeforeClose(Cancel As Boolean) Call Disable End Sub Private Sub Workbook_SheetCalculate(ByVal Sh As Object) Call Disable Call SetDelay End Sub Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, _ ByVal Target As Excel.Range) Call Disable Call SetDelay End Sub Right click 'ThisWorkbook' insert module and paste this in Dim DownTime As Date Sub SetDelay() DownTime = Now + TimeValue("00:05:00") 'change time as needed Application.OnTime DownTime, "CloseBook" End Sub Sub CloseBook() ThisWorkbook.Save ThisWorkbook.Close End Sub Sub Disable() On Error Resume Next Application.OnTime EarliestTime:=DownTime, _ Procedu="CloseBook", Schedule:=False End Sub Save and close the workbook and on reopening 5 minutes of inactivilty will cause it to save and close. -- Mike When competing hypotheses are otherwise equal, adopt the hypothesis that introduces the fewest assumptions while still sufficiently answering the question. "Robert Crandal" wrote: If no changes are made to my workbook after 5 minutes, I want to autosave and close the workbook. Is something like this possible? thank you . |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Question on VBA : how to detect "idle" condition | Excel Programming | |||
Time calculation (Subraction of Idle Time) | Excel Discussion (Misc queries) | |||
detecting application idle time in Excel 2000 | Excel Programming | |||
detecting idle time | Excel Discussion (Misc queries) | |||
Detecting user idle time | Excel Programming |