How can I write to a text file reliably from Excel VBA?

前端 未结 4 1831
心在旅途
心在旅途 2021-01-11 10:31

I\'m trying to use Excel VBA to write to a text file. I\'m doing a few of these:

MyFile1 = \"C:\\outputFromExcel1.txt\"
fnum1 = FreeFile()
Open MyFile1 For          


        
4条回答
  •  生来不讨喜
    2021-01-11 11:22

    You can use Close #fnum1 to close the file handle and it should flush the remaining buffer contents.

提交回复
热议问题