Inactive close

J

John Wilson

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>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top