Method: Close for TextStream
- Updated2024-09-12
- 1 minute(s) read
FileSystemObject and Dictionary > Methods > Method: Close for TextStream
Method: Close for TextStream
Closes an open TextStream file.
Object.Close
| Object | TextStream Object with this method |
The following example creates a text file, writes a text into this file, and then closes the file:
Sub CreateMyTxtFile(sFile,sText) Dim fso, oMyFile Set fso = CreateObject("Scripting.FileSystemObject") Set oMyFile = fso.CreateTextFile(sFile, True) Call oMyFile.WriteLine(sText) Call oMyFile.Close End Sub