03-05-2022
05:25 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
03-05-2022
05:25 AM
Hello
I'm not sure I understand the first three questions. Can you please explain a bit more in detail?
I can not see where _fileName is declared and which value it has. Error message says it is of type object, should be a string. If you want to append to your textfile like in a logfile, here's an alternative way:
Imports System.IO
Dim strFile As String = "C:\Temp\Log.txt"
Dim sw As StreamWriter
Try
If (Not File.Exists(strFile)) Then
sw = File.CreateText(strFile)
Else
sw = File.AppendText(strFile)
End If
sw.WriteLine("%%% PLACE YOUR LOG MESSAGE HERE %%%")
sw.Close()
Catch ex As IOException
MsgBox("Error writing to log file.")
End Try
R. Krieg
RKW Solutions
www.rkw-solutions.com