Signature (Visual Basic / VBA)
Public Function FileExists( _
ByVal vFileName As Variant _
, Optional ByVal vAttributes As Variant _
) As Boolean
Code Example
FileExists("C:\COMMAND.COM") = True
FileExists("C:\FILE0000.CHK") = False
Parameters
| Parameter | Description |
|---|---|
| vFileName | Name of the file or directory that will be checked for existence. Function returns False if vFileName is Null or cannot be fixed-up to a String. vFileName can contain the DOS Wildcard characters "*" and "?". |
| vAttributes | One or more of the vb constants vbNormal, vbHidden, vbSystem, vbVolume, and vbDirectory describing the allowable types of files. vAttributes defaults to vbNormal if it is missing or Null or cannot be fixed-up to a number. |