Sub ²£¥Í¤å¦rÀÉ()
xT = "¤å¦rÀɤº®e"
xFile = thisworkbook.path & "\" & format(date,"yyyymmdd") & ".txt"
Open xFile For Output As #1 'OutputÂл\¸ê®Æ
Print #1, xT
Close #1
End Sub
Sub ²£¥Í¤å¦rÀÉ_2()
xT = "¤å¦rÀɤº®e"
xFile = thisworkbook.path & "\" & format(date,"yyyymmdd") & ".txt"
Open xFile For Append As #1 'Append-¼g¦bÀɮתº§ÀºÝ...²Ö¼W
Print #1, xT
Close #1
End Sub
Option Explicit
Sub ²£¥Í¤å¦rÀÉ_Append_¼g¦bÀɮתº§ÀºÝ_²Ö¼W()
Dim xT$, xFile$
xT = "Åwªï¤@°_¨Ó¾Ç²ß!½×¾Â¨ä¹ê¨S¤°»òªùÂe!¼ç³W«h´N¬Oµê¤ß¾Ç²ß!"
xFile = ThisWorkbook.Path & "\" & Format(Date, "yyyymmdd") & ".txt"
Open xFile For Append As #1 'Append-¼g¦bÀɮתº§ÀºÝ...²Ö¼W
'https://learn.microsoft.com/zh-tw/office/vba/language/reference/user-interface-help/open-statement
Print #1, xT
Close #1
End Sub
ÁÂÁ«e½ú«ü¾É
ÁÂÁ½׾Â
Option Explicit
Sub CreateObject_Scripting_FileSystemObject_AND_OpenTextFile()
Dim fs, a
Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.CreateTextFile(ThisWorkbook.Path & "\" & Format(Date, "yyyymmdd") & ".txt", True)
a.WriteLine ("This is a test.")
a.Close
'https://learn.microsoft.com/zh-tw/office/vba/language/reference/user-interface-help/filesystemobject-object
End Sub
Sub CreateObject_ADODB_Stream()
'https://club.excelhome.net/thread-868093-1-1.html
End Sub