Andrew, there's a workbook here that I downloaded a while ago which does a similar thing. From the code, it looks like you need to set the Saved property to True on the way out, maybe? Edit- actually no, just need the disable Sub as below, link -
http://www.xl-logic.com/pages/vba.html<pre>
Dim SchedRecalc As Date
Sub SetTime()
SchedRecalc = Now + TimeValue("00:00:01")
Application.ontime SchedRecalc, "Recalc"
End Sub
Sub Recalc()
Range("Time").Value = Now
Call SetTime
End Sub
Sub Disable()
On Error Resume Next
Application.ontime EarliestTime:=SchedRecalc, Procedure:="Recalc", Schedule:=False
End Sub
Private Sub Workbook_Open()
Call SetTime
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Call Disable
ActiveWorkbook.Saved = True
End Sub</pre>
This message was edited by Mudface on 2002-12-12 07:36