
User Form close buttons and timer close
Hi I have a User Form splash screen that presents on WoekBook open.
There is a button to close the form. However, I want the form to
automatically close after 10 seconds if the button is not pressed.
I had code that worked in 2000, but in 97 does not. Now I need to make code
work in both. I have something that works but does not allow me to use the
close buttons, it just freezes the window until 10 seconds when it closes.
Private Sub UserForm_Activate()
Dim newHour, newMinute, newSecond, waitTime
Me.spTimer.Caption = "This window will close in 10 seconds"
newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 10
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime
Unload Me
End Sub
Private Sub spSplashProceed_Click()
Unload Me
End Sub