View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Billy Rogers[_2_] Billy Rogers[_2_] is offline
external usenet poster
 
Posts: 2
Default Display and close form automatically

Here's some code I'm working on. I want to display a message to the
user for approximately 3 seconds and then continue on with the code.
I've built a form with a message written on it. When i run this code
the form displays and then it doesn't do anything. The Sleep
function works fine.........I just don't know how to get the form to
close automatically.



On Error Resume Next

Shell BankNamePath, vbMaximizedFocus

If Err.Number = 5 Or Err.Number = 53 Then

UserForm1.Show
Sleep 3000
Unload UserForm1

Call OpenDefaultDiscTray
Sleep 5000
Call CloseDefaultDiscTray

Shell BankNamePath, vbMaximizedFocus

End If