Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Timer Code
Add this to a general module
Option Explicit Public nTime As Double Public Sub closemedown() ThisWorkbook.Save ThisWorkbook.Close End Sub and then add this to ThisWorkbook Option Explicit Private Sub Workbook_BeforeClose(Cancel As Boolean) Application.OnTime nTime, "closemedown", , False End Sub Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range) nTime = Now + TimeSerial(1, 30, 0) Application.OnTime nTime, "closemedown" End Sub Private Sub Workbook_Open() nTime = Now + TimeSerial(1, 30, 0) Application.OnTime nTime, "closemedown" End Sub -- --- HTH Bob (change the xxxx to gmail if mailing direct) "Al" wrote in message ... Hello I am having a problem with a file being left open and I would like code to automatically close the file after 90 minutes after the last change on any page in the wb with changes saved before the close. Can this be done? How? Thanks |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Timer Code | Excel Programming | |||
Timer code | Excel Programming | |||
A VB code for creating count down timer / stopwatch... | Excel Programming | |||
VBA Code help - first timer | Excel Programming | |||
How to code a timer to trigger a sub-routine ? | Excel Programming |