Helpp! possessed macro!
Posted by RoB on November 21, 2001 12:12 PM
Ok, i have a problem on my hands. I have an excel template with an auto shutdown after 15 minutes code in it. The code works fine. Recently, with the help of people on this board, i made a filesearch with an excel workbook. the file search is meant to find files, all of which use the above mentioned template.
Now, whats happening is, after a search is done, and a file is opened using the above template, then closed, about 15 minutes later, the file that was opened magically opens, saves, and closes again. This is begining to become a problem if for instance you have something open and are typing. Now, im not POSITIVE that its the shutdown part of the macro, but im 99% sure because of the timing. FYI, the search is being left open while files are opened and closed. Is the timer in the shutdown code maybe not stopping when the file is closed and continuing because the search is open?? PLEASE HELp! here is the shutdown code that is in each template (its NOT in the search code):
Dim DownTime As Date
Sub SetTime()
DownTime = Now + TimeValue("00:15:00")
Application.OnTime DownTime, "ShutDown"
End Sub
Sub ShutDown()
ActiveWorkbook.Save
ActiveWorkbook.Close
End Sub
Sub Disable()
On Error Resume Next
Application.OnTime EarliestTime:=DownTime, Procedure:="ShutDown", Schedule:=False
End Sub
Any help is appreciated!