Sub 生成_Click()
Dim gPath As String
Dim sFile As Object, Fso As Object
gPath = Application.ActiveWorkbook.Path
Set Fso = CreateObject("Scripting.FileSystemObject")
Set sFile = Fso.CreateTextFile(gPath & "/TestFile.txt", True)
sFile.WriteLine ("CreateTextFile Test1")
sFile.WriteLine ("CreateTextFile Test2")
sFile.WriteLine ("CreateTextFile Test3")
sFile.WriteLine ("CreateTextFile Test4")
sFile.Close
Set sFile = Nothing
Set Fso = Nothing
End Sub
阅读(1046) | 评论(0) | 转发(0) |