VBA DriveExists

The FileSystemObject VBA DriveExists function returns True if the drive exists otherwise will return False.

VBA DriveExists Syntax

fso.DriveExits( drivepath )

drivepath
A string representing the drive letter or path to the drive.

VBA DriveExists Examples

Below examples assume drive “C” exists and no other drives exists on workstation:

Set fso = CreateObject("Scripting.FileSystemObject")

Debug.Print fso.DriveExists("C") 'Result: True

Debug.Print fso.DriveExists("E") 'Result: False