0
我用這段代碼做了一個關於vba的日誌,然後我意識到如果數據已經很多了,那麼很難找到「新日誌」。有沒有修改這個代碼的方式,所以我能得到的數據的頂部(記事本/ TXT)登錄VBA
Sub WriteLogFile()
Dim iFileNumber As Long
Dim strData As String
Dim strFileName As String
iFileNumber = FreeFile()
strData = "Test data" 'the text written in the file
strFileName = "C:\test.log" ' the text file
Open strFileName For Append Shared As #iFileNumber
Print #iFileNumber, strData
Close #iFileNumber
End Sub
感謝您的意見 –
最受歡迎。希望能幫助到你 – stwissel