Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 147
Default Loading a Userform

Hi All,

I have a form that shows for about 5 seconds then unloads however when it
shows up the form is just white is there a way for it to show the info on it
my code is below,can someone help me?

Jason

Sub ShowForm()
Userform1.Show
End Sub

Dim MyTime
Private Sub UserForm_Activate()
MyTime = Time
x = MyTime
y = 0
MyNum = TimeValue("00:00:05")
Do Until y = 1
Z = x + MyNum
If x + MyNum <= MyTime Then
y = 1
End If
MyTime = Time
Loop
If y = 1 Then
UserForm1.Hide
End If
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default Loading a Userform

Try putting your delay code into the userform initialize event instead. You
also hide the form, this does not unload it. Note: you could more simply use
OnTime to initiate the delay e.g.

' in the user form code put this.....

Private Sub UserForm_Initialize()
Application.OnTime Now + TimeValue("00:00:05"), "fm_UnLoad"
End Sub


' in a standard module use these to load / unload the form

Sub fm_load()
UserForm1.Show
End Sub

Sub fm_UnLoad()
Unload UserForm1
End Sub

--
Cheers
Nigel



"Jason Zischke" wrote in message
...
Hi All,

I have a form that shows for about 5 seconds then unloads however when it
shows up the form is just white is there a way for it to show the info on

it
my code is below,can someone help me?

Jason

Sub ShowForm()
Userform1.Show
End Sub

Dim MyTime
Private Sub UserForm_Activate()
MyTime = Time
x = MyTime
y = 0
MyNum = TimeValue("00:00:05")
Do Until y = 1
Z = x + MyNum
If x + MyNum <= MyTime Then
y = 1
End If
MyTime = Time
Loop
If y = 1 Then
UserForm1.Hide
End If
End Sub



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Loading a Userform

Try this

Private Sub UserForm_Activate()
MyTime = Time
x = MyTime
y = 0
MyNum = TimeValue("00:00:05")
Me.Repaint
Do Until y = 1
Z = x + MyNum
If x + MyNum <= MyTime Then
y = 1
End If
MyTime = Time
Loop
If y = 1 Then
UserForm1.Hide
End If
End Sub



--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Jason Zischke" wrote in message
...
Hi All,

I have a form that shows for about 5 seconds then unloads however when it
shows up the form is just white is there a way for it to show the info on

it
my code is below,can someone help me?

Jason

Sub ShowForm()
Userform1.Show
End Sub

Dim MyTime
Private Sub UserForm_Activate()
MyTime = Time
x = MyTime
y = 0
MyNum = TimeValue("00:00:05")
Do Until y = 1
Z = x + MyNum
If x + MyNum <= MyTime Then
y = 1
End If
MyTime = Time
Loop
If y = 1 Then
UserForm1.Hide
End If
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
Loading website from userform Danny Boy via OfficeKB.com Excel Programming 0 January 29th 06 04:09 PM
Loading Userform Steven Cheng Excel Programming 3 December 9th 05 07:18 PM
Failed userform loading and cause application crash noiseash Excel Programming 1 August 25th 05 03:35 PM
Loading UserForm gives error Mats Samson Excel Programming 3 August 3rd 05 08:06 AM
Loading UserForm on start up. Kobus Excel Programming 2 April 1st 05 11:13 AM


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

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

About Us

"It's about Microsoft Excel"