Hi everyone. I was beginning to wonder why nobody said anything about the code, so I went back to the code to take a look. I'm glad I said it was a long time ago, because the code contained a lot of crap it didn't need in it. I was so worried about what to do if the logfile was gone, I didn't think about the code I was actually writing. So, I apologize for the code, and I will give you the updated version that does everything that the first code does.
And it's only 3 lines.
Public Sub LogToFile(LogMessage As String)
Using sw = AppendText(logfilename)
sw.WriteLine(LogMessage)
End Using
End Sub
I forgot that append would add to the file or create the file.
So yep, I'm dumb.