File Exists on Disk


Function DiskFileExists(sFilePathAndName As String) As Boolean
    
    ‘Returns True if the file exists, False if it doesn’t
    
    DiskFileExists = CBool(Len(Dir(sFilePathAndName)))
    
End Function

2 Comments

  1. SAMAD says:

    VERY NICE AND QUICK FUNCTION
    THANKS

  2. coffee joe says:

    Very Elegant!

Posting code or formulas in your comment? Use <code> tags!

  • <code lang="vb">Block of code goes here</code>
  • <code lang="vb" inline="true">Inline code goes here</code>
  • <code>Formula goes here</code>

Leave a Reply