Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default How does msgbox stop the OnTime event?

This way UserForm1 never closes if CommandButton2 is clicked.
And in case of the MsgBox, Userform1 closes after the MsgBox is dismissed.
In other words, MsgBox keeps the timer from firing until it is dismissed.

Thanks.

Emile

Perhaps:

Regular Code Module:

Public dFireTIme As Double


UserForm1:

Private Sub UserForm_Activate()
dFireTime = Now + TimeSerial(0, 0, 5)
Application.OnTime dFireTime, "closeThisForm"
End Sub

Private Sub CommandButton2_Click()
Application.OnTime dFireTime, "closeThisForm", Schedule:=False
UserForm2.Show
End Sub

UserForm2:

Private Sub UserForm_Deactivate()
Application.OnTime Now + TimeSerial(0, 0, 1), "closeThisForm"
End Sub



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find %ontime & SUMIF ontime ie: find matching sets within Range... Chris T-M Excel Worksheet Functions 3 October 10th 08 08:14 PM
OnTime bug? Antonio Excel Discussion (Misc queries) 0 June 9th 06 08:24 PM
OnTime VB [email protected] Excel Worksheet Functions 2 May 16th 06 08:43 PM
OnTime Help Mark Scholes Excel Programming 1 January 30th 04 03:48 AM
OnTime event not firing in Workbook_Open event procedure GingerTommy Excel Programming 0 September 24th 03 03:18 PM


All times are GMT +1. The time now is 05:22 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"