Wil Moosa
Well-known Member
- Joined
- Aug 11, 2002
- Messages
- 893
The following code shows after ten minutes -of use of the workbook- a message. When clicking the "OK" button the workbook will be closed.
I want to close the workbook automatically after ten seconds of showing the message. How can this be done?
Sub Timer_start()
Dim NextTime As Date
NextTime = Now + TimeValue("00:10:00")
Application.OnTime NextTime, "Message_before_Quit"
End Sub
Sub Message_Before_Quit()
MsgBox "Match Monitor will be closed within 10 seconds."
Application.run "Quit"
End Sub
Sub Quit()
Application.Quit
End Sub
I want to close the workbook automatically after ten seconds of showing the message. How can this be done?
Sub Timer_start()
Dim NextTime As Date
NextTime = Now + TimeValue("00:10:00")
Application.OnTime NextTime, "Message_before_Quit"
End Sub
Sub Message_Before_Quit()
MsgBox "Match Monitor will be closed within 10 seconds."
Application.run "Quit"
End Sub
Sub Quit()
Application.Quit
End Sub