Thread: Inactive close
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
John Wilson John Wilson is offline
external usenet poster
 
Posts: 550
Default Inactive close

Dave,

Plagiarized from a previous post by Tom Ogilvy...............
For reference, a Google search of "Inactivity Timeout" brought
it right up.

John

<snip

In the ThisWorkbook code module:

Public BootTime As Date
' Tom Ogilvy 8/18/99
Private Sub Workbook_Open()
BootTime = Now + TimeValue("00:30:00")
Application.OnTime BootTime, "CloseBook"
End Sub

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal
Target
As Excel.Range)
Application.OnTime BootTime, "CloseBook", , False
BootTime = Now + TimeValue("00:30:00")
Application.OnTime BootTime, "CloseBook"
End Sub

In a General Module

Sub CloseBook()
ThisWorkbook.Save
ThisWorkbook.Close
End Sub

<snip

Dave Hardy wrote:

Is there any way to have excel close down after a set
time of being inactive?