I tried to learn more but sadly I can't understand how it works with the Windows Task Scheduler, so I tried something simple, but it still doesn't work.
I want this function to run every day except the weekends.
Here is my code:
Sub automaticworkdayinsert()
If Timer4.Interval = 7200000 Then
Dim time As Date = Date.Now
Dim currhour As Integer
Dim currminute As Integer
Dim ReportHour As Integer
Dim ReportMinute As Integer
currhour = time.Hour
currminute = time.Minute
ReportHour = 15
ReportMinute = 10
If currhour = ReportHour AndAlso currminute = ReportMinute Then
insertAndcheckWorkday(False)
End If
End If
End Sub