PC Review


Reply
Thread Tools Rate Thread

display userform for 10 seconds

 
 
Sandy
Guest
Posts: n/a
 
      29th Sep 2008
Hi
I am trying to have a UserForm display for 10 seconds and then have the rest
of my sub proceed.


have tried

********
frmPrime.Show
Application.Wait Now + TimeValue("00:00:10")
frmPrime.Hide
********

but this just stops the code permanently. Any ideas?
Sandy

 
Reply With Quote
 
 
 
 
papou
Guest
Posts: n/a
 
      29th Sep 2008
Hi Sandy
Just amend this line:
frmPrime.Show vbModeless

HTH
Cordially
Pascal

"Sandy" <(E-Mail Removed)> a écrit dans le message de news:
(E-Mail Removed)...
> Hi
> I am trying to have a UserForm display for 10 seconds and then have the
> rest of my sub proceed.
>
>
> have tried
>
> ********
> frmPrime.Show
> Application.Wait Now + TimeValue("00:00:10")
> frmPrime.Hide
> ********
>
> but this just stops the code permanently. Any ideas?
> Sandy



 
Reply With Quote
 
Orion Cochrane
Guest
Posts: n/a
 
      29th Sep 2008
Try this:
UserForm object:
Private Sub UserForm_Activate()
Application.OnTime Now + TimeValue("00:00:10"), "KillTheForm"
End Sub

Kill Module
Private Sub KillTheForm()
Unload UserForm1
End Sub

I use this for making welcome splashes in certain programs. The
UserForm_Activate occurs when the userform is triggered by an event. The
userform will display for 10 seconds (as per OP), and the KillTheForm
procedure kicks in, which unloads the userform.
--
I am running on Excel 2003, unless otherwise stated. Please rate posts so we
know when we have answered your questions. Thanks.


"Sandy" wrote:

> Hi
> I am trying to have a UserForm display for 10 seconds and then have the rest
> of my sub proceed.
>
>
> have tried
>
> ********
> frmPrime.Show
> Application.Wait Now + TimeValue("00:00:10")
> frmPrime.Hide
> ********
>
> but this just stops the code permanently. Any ideas?
> Sandy
>
>

 
Reply With Quote
 
Sandy
Guest
Posts: n/a
 
      29th Sep 2008
Hi guys

Both work very well with the exception that the information on the userform
(labels) does not display - any ideas why this should happen?

Sandy

"Sandy" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi
> I am trying to have a UserForm display for 10 seconds and then have the
> rest of my sub proceed.
>
>
> have tried
>
> ********
> frmPrime.Show
> Application.Wait Now + TimeValue("00:00:10")
> frmPrime.Hide
> ********
>
> but this just stops the code permanently. Any ideas?
> Sandy


 
Reply With Quote
 
Orion Cochrane
Guest
Posts: n/a
 
      29th Sep 2008
What does this userform do?
--
I am running on Excel 2003, unless otherwise stated. Please rate posts so we
know when we have answered your questions. Thanks.


"Sandy" wrote:

> Hi guys
>
> Both work very well with the exception that the information on the userform
> (labels) does not display - any ideas why this should happen?
>
> Sandy
>
> "Sandy" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Hi
> > I am trying to have a UserForm display for 10 seconds and then have the
> > rest of my sub proceed.
> >
> >
> > have tried
> >
> > ********
> > frmPrime.Show
> > Application.Wait Now + TimeValue("00:00:10")
> > frmPrime.Hide
> > ********
> >
> > but this just stops the code permanently. Any ideas?
> > Sandy

>
>

 
Reply With Quote
 
Sandy
Guest
Posts: n/a
 
      29th Sep 2008
It is meant to simply display a message - "For further information refer to
bla bla" - for 10 seconds.
Sandy

"Orion Cochrane" <(E-Mail Removed)> wrote in message
news:4CABFD85-88AA-48DF-83B5-(E-Mail Removed)...
> What does this userform do?
> --
> I am running on Excel 2003, unless otherwise stated. Please rate posts so
> we
> know when we have answered your questions. Thanks.
>
>
> "Sandy" wrote:
>
>> Hi guys
>>
>> Both work very well with the exception that the information on the
>> userform
>> (labels) does not display - any ideas why this should happen?
>>
>> Sandy
>>
>> "Sandy" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>> > Hi
>> > I am trying to have a UserForm display for 10 seconds and then have the
>> > rest of my sub proceed.
>> >
>> >
>> > have tried
>> >
>> > ********
>> > frmPrime.Show
>> > Application.Wait Now + TimeValue("00:00:10")
>> > frmPrime.Hide
>> > ********
>> >
>> > but this just stops the code permanently. Any ideas?
>> > Sandy

>>
>>

 
Reply With Quote
 
Orion Cochrane
Guest
Posts: n/a
 
      29th Sep 2008
Make a label in the form big enough to display this message. Or you could
have a message box at the beginning of your code with the message. Once the
user clicks OK, the procedure will run. This may actually save time in that
the message box will not display for 10 seconds. Here's a sample of the
message box:
Sub Macro()
MsgBox "Your message here"
'Your code here
End Sub

The MsgBox will default to an OK button only if you copy my line to your
macro. I think the MsgBox route would be better, but I could be wrong.
--
I am running on Excel 2003, unless otherwise stated. Please rate posts so we
know when we have answered your questions. Thanks.


"Sandy" wrote:

> It is meant to simply display a message - "For further information refer to
> bla bla" - for 10 seconds.
> Sandy
>
> "Orion Cochrane" <(E-Mail Removed)> wrote in message
> news:4CABFD85-88AA-48DF-83B5-(E-Mail Removed)...
> > What does this userform do?
> > --
> > I am running on Excel 2003, unless otherwise stated. Please rate posts so
> > we
> > know when we have answered your questions. Thanks.
> >
> >
> > "Sandy" wrote:
> >
> >> Hi guys
> >>
> >> Both work very well with the exception that the information on the
> >> userform
> >> (labels) does not display - any ideas why this should happen?
> >>
> >> Sandy
> >>
> >> "Sandy" <(E-Mail Removed)> wrote in message
> >> news:(E-Mail Removed)...
> >> > Hi
> >> > I am trying to have a UserForm display for 10 seconds and then have the
> >> > rest of my sub proceed.
> >> >
> >> >
> >> > have tried
> >> >
> >> > ********
> >> > frmPrime.Show
> >> > Application.Wait Now + TimeValue("00:00:10")
> >> > frmPrime.Hide
> >> > ********
> >> >
> >> > but this just stops the code permanently. Any ideas?
> >> > Sandy
> >>
> >>

>

 
Reply With Quote
 
papou
Guest
Posts: n/a
 
      30th Sep 2008
Sandy
If the label already has text on it, and you want to change this text for
some time, then use the Repaint method:
Label1.Caption = ""For further information refer to bla bla"
UserForm1.Repaint
And use this method each time you change the label's text.

HTH
Cordially
Pascal

"Sandy" <(E-Mail Removed)> a écrit dans le message de news:
(E-Mail Removed)...
> It is meant to simply display a message - "For further information refer
> to bla bla" - for 10 seconds.
> Sandy
>
> "Orion Cochrane" <(E-Mail Removed)> wrote in
> message news:4CABFD85-88AA-48DF-83B5-(E-Mail Removed)...
>> What does this userform do?
>> --
>> I am running on Excel 2003, unless otherwise stated. Please rate posts so
>> we
>> know when we have answered your questions. Thanks.
>>
>>
>> "Sandy" wrote:
>>
>>> Hi guys
>>>
>>> Both work very well with the exception that the information on the
>>> userform
>>> (labels) does not display - any ideas why this should happen?
>>>
>>> Sandy
>>>
>>> "Sandy" <(E-Mail Removed)> wrote in message
>>> news:(E-Mail Removed)...
>>> > Hi
>>> > I am trying to have a UserForm display for 10 seconds and then have
>>> > the
>>> > rest of my sub proceed.
>>> >
>>> >
>>> > have tried
>>> >
>>> > ********
>>> > frmPrime.Show
>>> > Application.Wait Now + TimeValue("00:00:10")
>>> > frmPrime.Hide
>>> > ********
>>> >
>>> > but this just stops the code permanently. Any ideas?
>>> > Sandy
>>>
>>>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
If no activity, display a UserForm; 10 seconds later close Workboo ryguy7272 Microsoft Excel Programming 4 19th May 2010 12:05 AM
Display a picture for say 5 seconds and then display a message. Mufasa Microsoft ASP .NET 6 27th Jul 2007 12:09 AM
Close userform after 2 seconds =?Utf-8?B?S2VudA==?= Microsoft Excel Programming 1 17th Jan 2006 02:17 PM
Display Seconds in File Detail Display =?Utf-8?B?Y2JsYW5jaGU=?= Windows XP Customization 0 22nd Jul 2005 08:02 PM
How can I display seconds? Windows XP General 3 14th Feb 2004 10:46 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:22 PM.