Results 1 to 4 of 4

Running a code at a specific hour wont work if...

Threaded View

Joaoack Running a code at a specific... 10-19-2012, 04:53 PM
Artik Re: Running a code at a... 10-19-2012, 05:44 PM
Joaoack Re: Running a code at a... 10-22-2012, 06:56 AM
Joaoack Re: Running a code at a... 11-14-2012, 03:23 PM
  1. #1
    Registered User
    Join Date
    10-05-2012
    Location
    Rio de Janeiro
    MS-Off Ver
    Excel 2007
    Posts
    31

    Running a code at a specific hour wont work if...

    Hello all,

    I have a code inside "ThisWorkBook" module which calls another code in a specific time.
    The problem is that if you are opening the workbook for the first time, the code wont run when the clock hits 04:19 am. This code only works if you have already manually ran the code at least once before. After you close and re-open the workbook, you get the same problem again.

    The code is shown below:

    [I]Public RunTime1 As Date
    Public RunTime2 As Date
    
    Private Sub Workbook_Open()
    
    RunTime2 = TimeValue("04:19:00")
    Application.OnTime RunTime2, "MacroAutoRun2"
    
    RunTime1 = TimeValue("04:19:50")
    Application.OnTime RunTime1, "MacroAutoRun1"
    
    End Sub
    Thank you all in advance, for attention and patience.
    João
    Last edited by jeffreybrown; 10-19-2012 at 05:04 PM.

Thread Information

Users Browsing this Thread

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

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