Close statement
Close [[#filenumber] [, [#]filenumber],,,
The Close statement takes one argument filenumber. Filenumber is the number used with the Open statement to open the file. If the Close statement is used without any arguments it closes all open files.
Example
Sub Main
Open "c:\test.txt" For Input As #1
Do While Not EOF(1)
   MyStr = Input(10, #1)
   MsgBox MyStr
Loop
Close #1
 
End Sub
 
Sub Make3Files ()
   Dim I, FNum, FName   ' Declare variables.
   For I = 1 To 3
       FNum = FreeFile   ' Determine next file number.
       FName = "TEST" & FNum
       Open FName For Output As FNum   ' Open file.
       Print #I, "This is test #" & I   ' Write string to file.
       Print #I, "Here is another ";  "line";  I
   Next I
   Close   ' Close all files.
End Sub