Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello Everybody,
I have copied a code for a timer in a post and applied it to my workbook to automatically show a userform after a short period of time. My big problem is that when I close the workbook without quitting Excel the timer continue running and re-open my workbook after the preset period to show the userform again. Is there a way to have the timer stopped when closing the workbook? My code bellow: In Module: Option Explicit Public nSaveWB As Date Public Sub SetSaveWBTimer() nSaveWB = Now + TimeSerial(0, 0, 5) ' 5 minutes Application.OnTime nSaveWB, "SaveWB" End Sub Public Sub SaveWB() Alerte.Show End Sub In ThisWorkbook: Private Sub workbook_open() Alerte.Show End Sub In Userform: (called Alerte) Private Sub CommandButton1_Click() Alerte.Hide Call SetSaveWBTimer End Sub Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer) If CloseMode = vbFormControlMenu Then Call SetSaveWBTimer End If End Sub Thanks for your help. -- Regards, Cajeto 63. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How stop the "started office live" pop-up to stop. it is checked | Excel Discussion (Misc queries) | |||
To Stop or Not to Stop | Excel Discussion (Misc queries) | |||
How do I stop other circles in other cells to stop selecting? | Excel Worksheet Functions | |||
How do I stop other circles in other boxes to stop selecting? | Excel Worksheet Functions | |||
Macro: With Stop it works. Without Stop it doesn't. | Excel Programming |