Consulting

Results 1 to 3 of 3

Thread: Application.Ontime is LATE!

  1. #1
    VBAX Regular
    Joined
    Mar 2008
    Posts
    16
    Location

    Application.Ontime is LATE!

    ...Actually, it's not working at all! Could really use some help with app.ontime here. I've got the following code in a single wkbk ...but it doesn't work!
    Pls let me know what you think! Gracias!

    ..in "ThisWorkbook"
    [vba]Private Sub workbook_open()
    Application.ScreenUpdating = False
    Application.OnTime TimeSerial(10, 28, 0), "refresher"
    Application.ScreenUpdating = True
    End Sub[/vba]

    ...in Module15
    [vba]Sub refresher()

    Dim data As Variant
    Dim output()
    Dim I As Integer
    Dim y As Integer

    Application.ScreenUpdating = False

    Range("New_1030").ClearContents

    data = Range("PRICES")
    I = UBound(data, 2) ' cols
    y = UBound(data, 1) ' rows

    ReDim output(y, I)
    output = data

    Range("New_1030").Resize(y, I) = output
    ReDim output(y, I)

    Application.ScreenUpdating = True

    End Sub[/vba]
    Last edited by Aussiebear; 03-10-2011 at 01:46 PM. Reason: Adjusted correct code tags for User

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    refresher doesn't do much, so what makes you think it doesn't work?
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Regular
    Joined
    Mar 2008
    Posts
    16
    Location
    Hey Xld, you're right! refresher itself is very simple, and on occassion it DOES work, but is highly highly inconsistent.
    I KNOW it does not work most of the time because I can literally see if the 2nd range "new_1030" is updated and matches the source.

    It's a 15mb workbook with hundreds of live market data feeds, which could be complicating the process.
    Do you know if this is a known limitation or common hinderance to ontime?
    Sometimes it works if I'm on the active page as well... but less frequently if there are other workbooks open.

    Thoughts much appreciated.

    Thanks,
    L

Posting Permissions

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