Im trying for a message box to pop up but this code gives me always "Absent".How can i fix this.
Dim time As Date
Dim CurrHour As Integer
Dim CurrMinute As Integer
time = DateTime.Now
CurrHour = time.Hour ' Get current hour value
CurrMinute = time.Minute ' Get current minute value
If (CurrHour = 6 AndAlso CurrMinute > 14 And CurrHour = 7 AndAlso CurrMinute < 0) Or (CurrHour = 12 AndAlso CurrMinute > 14 And CurrHour = 13 AndAlso CurrMinute < 0) Then
MsgBox("Late")
ElseIf (CurrHour = 4 AndAlso CurrMinute > 0 And CurrHour = 6 AndAlso CurrMinute < 15) Or (CurrHour = 11 AndAlso CurrMinute > 0 And CurrHour = 12 AndAlso CurrMinute < 15) Then
MsgBox("Present")
Else
MsgBox("Absent")
End If