M
M
Matsun2018-03-11 16:07:49
Visual Basic
Matsun, 2018-03-11 16:07:49

Excel to CSV save function stopped working?

Used it all the time

Function SaveTXTfile(ByVal filename As String, ByVal txt As String) As Boolean
    On Error Resume Next: Err.Clear
    Set FSO = CreateObject("scripting.filesystemobject")
    Set ts = FSO.CreateTextFile(filename, True)
    ts.Write txt: ts.Close
    SaveTXTfile = Err = 0
    Set ts = Nothing: Set FSO = Nothing
End Function

Everything has always worked without question, and now, a few days ago, the function suddenly stopped working. Tested on 2 PCs. It does not give any errors, it just saves an empty 0 KB file to disk. What happened to the function suddenly?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question