PDA

View Full Version : Application.Ontime is LATE!



lijon
03-10-2011, 01:36 PM
...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"
Private Sub workbook_open()
Application.ScreenUpdating = False
Application.OnTime TimeSerial(10, 28, 0), "refresher"
Application.ScreenUpdating = True
End Sub

...in Module15
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

Bob Phillips
03-10-2011, 02:39 PM
refresher doesn't do much, so what makes you think it doesn't work?

lijon
03-11-2011, 05:08 AM
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