title: Don't know how to run a Function at a specific time
body: <p>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.</p>
  
  <p><strong>I want this function to run every day except the weekends.</strong></p>
  
  <p>Here is my code:</p>
  
  <pre><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
  </code></pre>