+ Reply to Thread
Results 1 to 2 of 2

run macro at the hour

Hybrid View

luis6777 run macro at the hour 01-09-2015, 03:34 PM
gmr4evr1 Re: run macro at the hour 01-09-2015, 08:22 PM
  1. #1
    Forum Contributor
    Join Date
    01-28-2013
    Location
    Rugby
    MS-Off Ver
    365
    Posts
    205

    run macro at the hour

    Good afternoon

    I would like some help to change the below macro so it runs every hour at the hour

    Thanks in advance

    Sub Macro1()
    ' Generated by the Reflection Macro Recorder on 01-09-2015 15:22:01.22.
    ' Generated by Reflection for UNIX and OpenVMS 14.0.
    '
    ' Print the screens at the hour
    '
        
    
        On Error GoTo ErrorHandler
    
        Const NEVER_TIME_OUT = 0
    
        Dim CR As String    ' Chr(rcCR) = Chr(13) = Control-M
        Dim ESC As String   ' Chr(rcESC) = Chr(27) = Control-[
    
        CR = Chr(Reflection2.ControlCodes.rcCR)
        ESC = Chr(Reflection2.ControlCodes.rcESC)
    
        With Session
            .StatusBar = "Waiting for Prompt: Totals  11794 489319576  412 564  12739   7231  24700    734  1979"
            .WaitForString ESC & "[0$}", NEVER_TIME_OUT, rcAllowKeystrokes
            .StatusBar = ""
            ' Press VtPf1 (Perform the VT terminal PF1 function).
            .TransmitTerminalKey rcVtPF1Key
    
            .StatusBar = "Waiting for Prompt: Use <Next> or <Prev> to view other order types"
            .WaitForString ESC & "[24;1HUse <Next> or <Prev> to view other order types", NEVER_TIME_OUT, rcAllowKeystrokes
            .StatusBar = ""
           ' Press VtF13 (Perform the Vt F13 function (LF)).
            .TransmitTerminalKey rcVtF13Key
    
            .WaitForString ESC & "[0;1;3'{", NEVER_TIME_OUT, rcAllowKeystrokes
            .Transmit "D"
    
            .WaitForString ESC & "[0;1;3'{", NEVER_TIME_OUT, rcAllowKeystrokes
            ' Press CursorUp (Move the cursor up one line).
            .TransmitTerminalKey rcVtUpKey
    
            .WaitForString ESC & "[0;1;3'{", NEVER_TIME_OUT, rcAllowKeystrokes
            .Transmit CR
    
            .StatusBar = "Waiting for Prompt: Use <Next> or <Prev> to view other order types"
            .WaitForString ESC & "[24;1HUse <Next> or <Prev> to view other order types", NEVER_TIME_OUT, rcAllowKeystrokes
            .StatusBar = ""
            
        End With
        Exit Sub
    
    ErrorHandler:
        Session.MsgBox Err.Description, vbExclamation + vbOKOnly
    
        ' Recording stopped at 15:23:50.31.
    End Sub
    Last edited by alansidman; 01-09-2015 at 03:47 PM.

  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: run macro at the hour

    Will this work for you?
    Sub ScheduleMacro1()
    TimeToRun = Now + TimeValue("01:00:00")
    Application.OnTime TimeToRun, "Macro1"
    End Sub
    Last edited by gmr4evr1; 01-09-2015 at 08:22 PM. Reason: Fix typo in code
    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

+ 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. [SOLVED] Formula to convert 24 hour day to 8 hour (working) day?
    By miro2021 in forum Excel General
    Replies: 4
    Last Post: 07-31-2017, 10:06 AM
  2. Calculate employees working from hour to hour
    By otter in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-03-2014, 08:57 AM
  3. VBA Script to run a macro on the hour every hour
    By warmajam in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-14-2014, 11:24 AM
  4. Replies: 0
    Last Post: 03-07-2014, 11:26 AM
  5. [SOLVED] convert decimal numbers to a fraction of an hour for payroll hour
    By Flower in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-10-2006, 03:50 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