【发布时间】:2010-10-25 19:11:22
【问题描述】:
我有一个输出到文本文件的 Excel VBA 宏。文本文件底部总是有一个空白行,我很难摆脱它。任何有用的建议将不胜感激!谢谢
Sub testExport()
Dim fPath As String, exportTxt As String
fPath = CreateObject("WScript.Shell").SpecialFolders("Desktop") & "\Sample_" & Format(Now(), "HHNNSS") & ".txt"
exportTxt = "Project: Sample Output" & vbCrLf
exportTxt = exportTxt & "Model Version: 1 "
Open fPath For Append As #1 'write the new file
Print #1, exportTxt
Close #1
结束子
【问题讨论】: