Function TestFileExists(filenm As String) As Integer ' tests if file exists, returns 1 for yes, 0 for no on Error Goto FErrorHandler ' test file If (Dir$(filenm)="") Then ' no file exists TestFileExists = 0 Else ' file exists TestFileExists = 1 End If Exit Function FErrorHandler: TestFileExists = 0 Exit Function End Function