Function to Check If File Exists Using Excel VBA

The following Excel VBA function may be used to test if a file exists. The wbName parameter refers to the full path of a specific file. The function will return true if the file is found.

Option Explicit

Function IsFileExist(wbName As String) As Boolean
    IsFileExist = Len(Dir(wbName))
End Function

Leave a Comment