View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JE McGimpsey JE McGimpsey is offline
external usenet poster
 
Posts: 4,624
Default Excel/Visual Basic

Without seeing your code, it's hard to tell, but I suspect the reason is
that you're using a comparision, e.g.:

If Time oldTime + TimeSerial(0, 1, 0) Then ...

Since Time is actually a value based on fractional days (e.g., 0:00 = 0,
12:00 = 0.5, 11:59 PM = 0.999305555555556), the comparison will fail at
midnight.

You might consider using an OnTime macro, instead:

http://cpearson.com/excel/ontime.htm





In article ,
"MikeS" wrote:

I am using the timer function in a macro to re-run a web query after a set
amount of time. I am using this to continuously update the current weather
and company stock prices for a "Video Bulletin Board. The problem is, the
macro aborts every night at 11:59. Can anyone tell me why this is happening
and how to fix it?

Thanks in advance.

Mike