I would store the last time your function was called in a global variable, and check it before attempting to run the code in this function.
For instance, in a module somewhere:
Public lastRun as String
Then your code would look something like:
Dim dt As DateTime = DateTime.Now
Dim strHours As String
Dim strMinutes As String
strTime = dt.ToString()
strHours = dt.Hour.ToString()
strMinutes = dt.Minute.ToString()
strTime = strHours & ":" & strMinutes
If lastRun <> strTime Then
lastRun = strTime
Else
End If
This way your code will only run once when the target time is reached.
- Pete