Hi Lewis,
Try this:
Paste this code in module1:
Const idleTime = 30 'seconds
Public isActive As Boolean
Dim Start
Sub StartTimer()
Start = Timer
Do While Timer < Start + idleTime
DoEvents
Loop
If Not isActive Then
If MsgBox("Idle for " & idleTime & " seconds. Close workbook ?", vbQuestion + vbYesNo) = vbYes Then
ActiveWorkbook.Close
Else
isActive = False
StartTimer
End If
Else
isActive = False
StartTimer
End If
End Sub
Paste this code in ThisWorkbook:
Private Sub Workbook_Open()
Module1.isActive = True
StartTimer
End Sub
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Module1.isActive = True
StartTimer
End Sub
Hope it helps...