CodeItBetter Programming Another VB Programming Blog

How to Close a File for a given File Number

Posted on January 5, 2009
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
'File/Folder Handling - How to Close a File for a given File Number
Option Explicit
 
Public Function CloseFile(ByVal FileNumber As Long) As Boolean
    On Error GoTo CloseFile_Error
 
    Close #FileNumber
    CloseFile = True
 
ExitHere:
    On Error GoTo 0
    Exit Function
 
CloseFile_Error:
    CloseFile = False
    MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure CloseFile of Form Form1"
End Function
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


 

No trackbacks yet.