On Jan 18, 8:02=A0am, "Auric__" <not.my.r...@[EMAIL PROTECTED]
> wrote:
> On Fri, 18 Jan 2008 03:25:41 GMT, Derek wrote:
> > On Jan 15, 3:55=A0pm, "Auric__" <not.my.r...@[EMAIL PROTECTED]
> wrote:
> >> On Tue, 15 Jan 2008 20:29:23 GMT, Yamauchi, Taka**** wrote:
> >> > I wonder if someone can give me some suggestion.
>
> >> > I want to show a label 1 second, and erase it and show it again.
>
> >> > label.visible =3D true
> >> > pauseme(1000)
> >> > label.visible =3D false
> >> > pauseme(1000)
> >> > label.visible =3D true,.....
>
> >> > To show them properly, I used Me.Refresh in VB6. I want to do
> >> > the same thing in Excel VBA. But if I insert Me.Refresh in my
> >> > VBA code, I simply get an error message saying that there is no
> >> > such function Me.Refresh. How can I correct this? How can I show
> >> > labels, pictures, or texts, back and forth on an Excel VBA
> >> > userform?
>
> >> > Thank you in advance for your help.
>
> >> You could try something like this:
>
> >> 'it's up to you to determine what exit_condition is
> >> Do Until exit_condition
> >> =A0 =A0 Label.Visible =3D Not Label.Visible
> >> =A0 =A0 t =3D Now + 1
> >> =A0 =A0 Application.Wait t =A0'this might pause the entire app -- not
> >> sure
>
> >> Loop
>
> >> Instead of Application.Wait, you could also try Sleep + DoEvents.
>
> >> In the future, I recommend you ask Excel-related questions here:
> >> =A0 =A0 microsoft.public.excel.programming
>
> >> --
> >> What you are, not what you have, is what makes you rich.- Hide
> >> quoted text
> > =A0-
>
> >> - Show quoted text -
>
> > Must admit for this sort of thing I normally just use DoEvents and
> > everything generally works fine. The problem with Sleep is that it
> > may affect the system clock. Just add a DoEvents after each
> > Label.Visible assignment.
>
> Same here -- normally I would do something more like this:
>
> jump_target:
> =A0 t=3Dtimer
> =A0 do until timer >=3D t + 1
> =A0 =A0 label.visible =3D not label.visible
> =A0 =A0 doevents
> =A0 =A0 if exit_condition then goto next_line 'gasp! teh eeeevil goto!
> =A0 loop
> =A0 goto jump_target 'gasp! teh eeeevil goto again!
> next_line:
>
> ...but application.wait seemed to be more along the lines of what the
> OP wanted. (And I don't *think* it's the same as sleep.)
>
Fair enough. It also occurs to me that even though Me.Refresh isn't
available, Me.Repaint should have much the same effect.
Cheers
Derek


|