Experts Exchange connects you with the people and services you need so you can get back to work.
public sub WriteLog(byval dt as DateTime,byval Value1 as string,byval Value2 as string,byval Value3 as string)
On Error GoTo EHandler
Dim Handle As Integer
Handle = FreeFile
Open "c:\temp\LogFile.csv" For Append As #Handle
Print #Handle, dt & " " & value1 & " " & value2 & " " & value3
On Error Resume Next
Open in new window
SET objFSO = CreateObject("Scripting.FileSystemObject")
SET objOutputFile = objFSO.CreateTextFile("log.txt", True)
Function Writelog(DateTime, Value1, Value2, Value3)
objOutputfile.writeline DateTime & "," & Value1 & "," & Value2 & "," & Value3
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.