ray88’s diary

お仕事で困ったとき用の自分用の覚書

ExcelVBA ファイルパスの有無を確認する

ExcelVBA 目次 - ray88’s diary

'-----------------------------------------------------------
'機能:指定されたファイルパスが存在するかどうかを確認する
'引数1:確認対象のファイルパス
'戻り値:ファイルパスが存在する場合はTrue
'              存在しない場合はFalse
'-----------------------------------------------------------
Function fncFileExists(filepath As String) As Boolean
    If Len(Dir(filepath)) > 0 Then
        fncFileExists = True
    Else
        fncFileExists = False
    End If
End Function