Using Me.Refresh in Excel VBA - basic.visual

This is a discussion on Using Me.Refresh in Excel VBA - basic.visual ; I wonder if someone can help me. I want to show a label for 1 second, make it invisible for 1 sec., and then show it again,.. so on. label1.visible = true pauseme(1000) label1.visible = false pauseme(1000) label1.visible = true, ...

+ Reply to Thread
Results 1 to 6 of 6

Using Me.Refresh in Excel VBA

  1. Default Using Me.Refresh in Excel VBA

    I wonder if someone can help me.
    I want to show a label for 1 second, make it invisible for 1 sec., and then
    show it again,.. so on.

    label1.visible = true
    pauseme(1000)
    label1.visible = false
    pauseme(1000)
    label1.visible = true, ......

    When I used VB6, I insserted Me.Refresh in the code, so I can show the label
    back and forth.

    I want to do the same thing in Excel VBA. When I inserted Me.Refresh in
    Excel VBA, however, I simply got an error message saying that there is no
    such function "Me.Refresh". How can I show a label, text or picture on and
    off on a userform of Excel VBA? Is there any equivalent function like
    Me.Refresh?


    thank you in advance for your help.

    Takashi Yamauchi



  2. Default Re: Using Me.Refresh in Excel VBA

    "Yamauchi, Takashi" <takashi-yamauchi@tamu.edu> wrote in message
    news:fmj5hn$3ou$1@news.tamu.edu...
    >I wonder if someone can help me.
    > I want to show a label for 1 second, make it invisible for 1 sec., and
    > then show it again,.. so on.
    >
    > label1.visible = true
    > pauseme(1000)
    > label1.visible = false
    > pauseme(1000)
    > label1.visible = true, ......
    >
    > When I used VB6, I insserted Me.Refresh in the code, so I can show the
    > label back and forth.
    >
    > I want to do the same thing in Excel VBA. When I inserted Me.Refresh in
    > Excel VBA, however, I simply got an error message saying that there is no
    > such function "Me.Refresh". How can I show a label, text or picture on
    > and off on a userform of Excel VBA? Is there any equivalent function
    > like Me.Refresh?


    In VB I'd suggest using a timer control and toggling the Visible property
    each time it fires rather than using any sort of sleep function

    For Excel VBA you should ask in an Excel programming group; VBA is close,
    but not quite the same as VB


  3. Default Re: Using Me.Refresh in Excel VBA

    On Tue, 15 Jan 2008 20:37:11 GMT, Yamauchi, Takashi wrote:

    > I wonder if someone can help me.
    > I want to show a label for 1 second, make it invisible for 1 sec.,
    > and then show it again,.. so on.
    >
    > label1.visible = true
    > pauseme(1000)
    > label1.visible = false
    > pauseme(1000)
    > label1.visible = true, ......
    >
    > When I used VB6, I insserted Me.Refresh in the code, so I can show
    > the label back and forth.
    >
    > I want to do the same thing in Excel VBA. When I inserted
    > Me.Refresh in Excel VBA, however, I simply got an error message
    > saying that there is no such function "Me.Refresh". How can I show
    > a label, text or picture on and off on a userform of Excel VBA?
    > Is there any equivalent function like Me.Refresh?
    >
    >
    > thank you in advance for your help.
    >
    > Takashi Yamauchi


    You need to learn how to cross-post.

    --
    Beware when God lets loose a thinker on this planet.

  4. Default Re: Using Me.Refresh in Excel VBA

    In message <fmj5hn$3ou$1@news.tamu.edu>, "Yamauchi, Takashi"
    <takashi-yamauchi@tamu.edu> writes
    >I wonder if someone can help me.
    >I want to show a label for 1 second, make it invisible for 1 sec., and
    >then show it again,.. so on.


    I'm no expert in Excel but in the latest version there is an OnTime
    function. Hope that may help.

    Regards
    --
    Martin Trump

  5. Default Re: Using Me.Refresh in Excel VBA

    "Bob Butler" <noway@nospam.ever> wrote

    > For Excel VBA you should ask in an Excel programming
    > group; VBA is close, but not quite the same as VB


    And, generic VBA isn't going to answer the question either -- "Me" is a VBA
    shortcut that in Access refers to the active form or report (in whose module
    the code is executing); to what it refers in the Excel object model may be
    something else entirely (as Excel itself has neither Forms nor Reports,
    though it can use Microsoft Forms).

    Larry Linson
    Microsoft Access MVP



  6. Default Re: Using Me.Refresh in Excel VBA

    On 15 Jan, 20:37, "Yamauchi, Takashi" <takashi-yamau...@tamu.edu>
    wrote:

    > I want to show a label for 1 second, make
    > it invisible for 1 sec., and then show it
    > again,.. so on.
    > label1.visible = true
    > pauseme(1000)
    > label1.visible = false
    > pauseme(1000)
    > label1.visible = true, ......
    > When I used VB6, I insserted Me.Refresh


    I don't know whether there is a Timer Control available in VBA, or
    whether it is possible to create your own API Timer, but if there is
    then that's what I would suggest you use. However, your existing code
    will work in VBA if you use DoEvents. Something like:

    Dim n As Long
    For n = 1 To 10
    Label1.Visible = Not Label1.Visible
    DoEvents
    ' perform your wait here
    Next n

    Mike




+ Reply to Thread