+ Reply to Thread
Results 1 to 6 of 6

Reflections WRQ VBA Macro Timer, Pause, or Wait command

  1. #1
    Registered User
    Join Date
    06-12-2008
    Posts
    29

    Reflections WRQ VBA Macro Timer, Pause, or Wait command

    I have recorded a .rbs script file in Reflections, the only thing it does is press the page up button about 40 times. The problem is when I run the macro the pages go by so fast I can't see the information i'm looking for on the page. I don't know if the right thing i'm looking for is a timer, pause, or wait command.

    I would like the macro to pause for about 3 seconds on each page which will give me adequate time to visually scan the page for what i'm looking for.

    As a nice to have it would be great if the macro would stop if I pressed any key on the keyboard. Thanks

  2. #2
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Reflections WRQ VBA Macro Timer, Pause, or Wait command

    Have you tried this...
    Please Login or Register  to view this content.
    or...
    Please Login or Register  to view this content.
    These will both give a 3 second pause
    Last edited by gmr4evr1; 05-29-2015 at 02:00 PM.
    1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG
    You don't have to add Rep if I have helped you out (but it would be nice), but please mark the thread as SOLVED if your issue is resolved.

    Tom

  3. #3
    Registered User
    Join Date
    06-12-2008
    Posts
    29

    Re: Reflections WRQ VBA Macro Timer, Pause, or Wait command

    Thanks for the quick response. I tried the code and it gave me a message of invalid time argument.
    Below is a snapshot of the code i'm using with what you gave me inserted.

    Sub Pageup()
    ' Generated by the Reflection Macro Recorder on 05-29-2015 11:14:27.30.
    ' Generated by WRQ Reflection for ReGIS Graphics 11.0.
    On Error GoTo ErrorHandler

    Const NEVER_TIME_OUT = 0

    Dim ESC As String ' Chr$(rcESC) = Chr$(27) = Control-[

    ESC = Chr$(rcESC)

    With Session
    .StatusBar = "Waiting for Prompt: FUNCTION KEY>"
    .WaitForString "", NEVER_TIME_OUT, rcAllowKeystrokes
    .StatusBar = ""
    ' Press VtPrevScreen (Perform the Previous Screen function).
    .TransmitTerminalKey rcVtPrevScreenKey



    Application.Wait Now() + 3 / 86400



    .StatusBar = "Waiting for Prompt: FUNCTION KEY>"
    .WaitForString ESC & "", NEVER_TIME_OUT, rcAllowKeystrokes
    .StatusBar = ""
    ' Press VtPrevScreen (Perform the Previous Screen function).
    .TransmitTerminalKey rcVtPrevScreenKey




    Application.Wait Now() + 3 / 86400



    .StatusBar = "Waiting for Prompt: FUNCTION KEY>"
    .WaitForString ESC & "", NEVER_TIME_OUT, rcAllowKeystrokes
    .StatusBar = ""
    ' Press VtPrevScreen (Perform the Previous Screen function).
    .TransmitTerminalKey rcVtPrevScreenKey

    Exit Sub

    ErrorHandler:
    .MsgBox Err.Description, vbExclamation + vbOKOnly

    End With
    ' Recording stopped at 11:15:02.66.
    End Sub

  4. #4
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Reflections WRQ VBA Macro Timer, Pause, or Wait command

    Maybe remove the () after Now? If not, did you try the 2nd code I provided?

  5. #5
    Registered User
    Join Date
    06-12-2008
    Posts
    29

    Re: Reflections WRQ VBA Macro Timer, Pause, or Wait command

    Thank you for your help. I continued to research and figured it out. I simply had to insert Session.Wait "3", this causes the program to wait 3 seconds before it simulates pressing the page up button again. Thanks for looking into this for me.

    Session.Wait "3"
    .TransmitTerminalKey rcVtPrevScreenKey

    Session.Wait "3"
    .TransmitTerminalKey rcVtPrevScreenKey

    Session.Wait "3"
    .TransmitTerminalKey rcVtPrevScreenKey

    Session.Wait "3"
    .TransmitTerminalKey rcVtPrevScreenKey

  6. #6
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Reflections WRQ VBA Macro Timer, Pause, or Wait command

    Sorry about that, when I first posted the suggestions, I didn't realize that you were using "With Session". Actually I didn't realize it even after you posted your code until now...oops.
    I'm glad you were able to get it worked out though.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Pause and Resume for Excel timer
    By unfolgsamone in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-09-2014, 05:25 PM
  2. Replies: 0
    Last Post: 06-24-2013, 04:24 PM
  3. wait/pause during loop
    By _Terry_ in forum Excel General
    Replies: 4
    Last Post: 07-04-2008, 03:22 PM
  4. pause vba action without using Application.Wait?
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-21-2005, 03:15 PM
  5. Macro Wait command
    By Donkin in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-02-2005, 06:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1