Handling Files with Low-Level File Handling : FreeFile « File Path « VBA / Excel / Access / Word






Handling Files with Low-Level File Handling

 
Sub LogErrorText()
    Dim intFile As Integer

    intFile = FreeFile

    Open CurDir & "\ErrorLog.Txt" For Append Shared As intFile

    Write #intFile, "LogErrorDemo", Now, Err, Error, CurrentUser()

    Close intFile
End Sub

 








Related examples in the same category

1.Examples of the VBA Open Statement
2.An Example Using Write # and Input #
3.Text Files and File Dialog
4.Writing to Text Files Using Print
5.Reading Data Strings
6.Flexible Separators and Delimiters
7.uses the delimiter characters to decide the data type of each item and treat it appropriately: