Fast Routine to Check File Existance

Category:
Files and Directories
Type:
Snippets
Difficulty:
Intermediate
Author:
Shinobi92

Version Compatibility: Visual Basic 6, Visual Basic 5

More information:
To check if a file exists, many people use the Dir function but that function can be slow and fails if you are going to check drives that aren't ready. This alternative uses the API.

Instructions: Copy the declarations and code below and paste directly into your VB project.

Declarations:

Code: