Excel tip: Create a log fileDate: 6 september 2001The following code will write data to a log/text file. If the file doesn't exist yet, it will be automaticly created. New entries will be added every time at the bottom of the log file. Copy-paste friendly code: Sub WriteLogFile()
' writes data to a text file ' new entries will be added at the bottom of the file. ' if the file does not exists, it will be created. 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 « back | ||
Home
Privacy Policy
Cookie Policy
EULA
Sitemap
Search
List of all utilities
Printer friendly page
Contact Us
^ Back to Top
© 1999-2021 - Bastien Mensink - ASAP Utilities - A Must in Every Office BV - The Netherlands
Connect with us and receive our tips that show you how to benefit from the tools in ASAP Utilities at:
![]() ![]() |