FreeFile (function)

Syntax

FreeFile[()]

Description

Returns an Integer containing the next available file number.

Comments

The number returned is suitable for use in the Open statement and will always be between 1 and 255 inclusive.

Example

This example assigns A to the next free file number and displays it in a dialog box.

Sub Main()
 a = FreeFile
 MsgBox "The next free file number is: " & a
End Sub

See Also

FileAttr (function); Open (statement).

More information

F