VBA ファイル存在確認

Function echo1()

    Dim strFile As String 'チェック対象となるファイル名
    Dim strName As String
    
    strFile = Application.CurrentProject.Path & "\Excel経歴書出力用\" & "lock"
    
    strName = Dir(strFile, vbNormal) 'ファイル名を得る
    
    If (strName = "") Then
        'ファイルが存在しないときの処理
    Else
        'ファイルが存在するときの処理
        Application.Quit
    End If


End Function