Please help me with this one. Sorry to go over this again.
ttb.xls:
ThisWorkbook:
Option Explicit
Public Sub Workbook_Open()
timer
End Sub
Public Sub Workbook_BeforeClose(cancel As Boolean) 'was Private Sub.... before
cancel_timer
End Sub
Module1
Option Explicit
Public rt As Double
Public Sub timer()
rt = Now + TimeValue("00:00:10")
Range("a1") = rt
Application.OnTime rt, "timer"
End Sub
Public Sub cancel_timer()
Application.OnTime rt, "timer", , False
End Sub
The above works fine. Beforeclose cancels the timer.
However, try to close ttb.xls from tta.xls using:
Sub main()
Workbooks("ttb.xls").Close SaveChanges:=False
End Sub
You will see that it gives you no error, closes ttb.xls. BUT ttb.xls reopens
again shortly after.
Please tell me I am missing something, I hope it is not a bug.
After substantial time and extra work to circunvent this I want to get to
the bottom of the issue.
Many thanks,
Antonio
Bookmarks