title: Why won't this write to my text file in Visual Basic?
body: <p>I have been trying and searching for hours and everything is telling me to do exactly as I am doing, so why won't this code write to my text file? No errors are being thrown, just the data won't write</p>
  
  <pre><code>Dim newDay As Boolean = True
  Dim attendance As StreamWriter
      If newDay = True Then
          Try
              attendance = File.AppendText("attendanceLog.txt")
              attendance.WriteLine(Date.Today.ToString("dd/MM/yyyy"))
              newDay = False
          Catch
              MessageBox.Show("File access denied", "Error")
          End Try
      End If
  </code></pre>