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

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
 
M

Michael Bauer

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top