Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Basic Misc > Re: Using "Me.R...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 7 of 7 Topic 1420 of 1583
Post > Topic >>

Re: Using "Me.Refresh" in Excel VBA

by Derek <derekrss@[EMAIL PROTECTED] > Jan 18, 2008 at 08:19 PM

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
 




 7 Posts in Topic:
Using "Me.Refresh" in Excel VBA
"Yamauchi, Takashi&q  2008-01-15 14:29:23 
Re: Using "Me.Refresh" in Excel VBA
"Judson McClendon&qu  2008-01-15 15:54:08 
Re: Using "Me.Refresh" in Excel VBA
"Auric__" <n  2008-01-15 22:55:32 
Re: Using "Me.Refresh" in Excel VBA
Derek <derekrss@[EMAIL  2008-01-17 19:25:41 
Re: Using "Me.Refresh" in Excel VBA
"Auric__" <n  2008-01-18 15:02:59 
Re: Using "Me.Refresh" in Excel VBA
"Auric__" <n  2008-01-18 15:06:59 
Re: Using "Me.Refresh" in Excel VBA
Derek <derekrss@[EMAIL  2008-01-18 20:19:16 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Oct 12 4:46:15 CDT 2008.