+ Reply to Thread
Results 1 to 4 of 4

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

  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:

    Please Login or Register  to view this content.
    Thank you all in advance, for attention and patience.
    Joćo
    Last edited by jeffreybrown; 10-19-2012 at 05:04 PM.

  2. #2
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,248

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

    Perhaps you mean such solution:
    Please Login or Register  to view this content.
    Artik

  3. #3
    Registered User
    Join Date
    10-05-2012
    Location
    Rio de Janeiro
    MS-Off Ver
    Excel 2007
    Posts
    31

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

    Artik,

    First of all thanks for replying.

    I didnt understand why my code wont work if the workbook is opened before RunTime2.

    Moving forward, I tested your code and it seems to work (thanks for that). Even though, it got me thinking: the code you wrote shouldnt make my code to run over and over forever? After 04:19, Time function will always be > than Runtime2. Why wont the macro run again after the first time it was ran then? On the second time, when Myworkbook module checks the if condition, Time will again be > than 04:19, agree?
    Last edited by Joaoack; 10-22-2012 at 08:07 AM.

  4. #4
    Registered User
    Join Date
    10-05-2012
    Location
    Rio de Janeiro
    MS-Off Ver
    Excel 2007
    Posts
    31

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

    Can anyone please assist?

+ Reply to Thread

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