Help!? I think this is something simple...

  • Thread starter Thread starter -=Sojourn=-
  • Start date Start date
S

-=Sojourn=-

I have this code that I want to run once per hour, but
the g_iHour seems to keep going back to null... Any help is
appreciated! Thanks!

Peter

Dim g_iHour

Private Sub Application_NewMail()
Dim iHour

iHour = Hour(Now)
If (iHour <> g_iHour) Then
' Do stuff once per hour
g_iHour = iHour
End Sub
End Sub
 
the g_iHour seems to keep going back to null...

Why do you think that? I cannot find any reasons for that in the code
you are showing us.

This is not very important but I also didn´t understand the meaning of
your code. Depending on new mails arriving there might be just a few
seconds between to actions (your "stuff once per hour") or even some
hours.
 
Back
Top