Function FileExist(FileName As String) As Boolean
On Error Goto NotExist 'Se non viene aperto (errore) in file non esiste Close #1 Open FileName For Input As #1 Close #1 FileExist = True 'Se viene aperto il file esiste Exit Function NotExist: FileExist = False End Function Private Sub Command1_Click() If FileExist("C:\COMMAND.COM") = True Then _ MsgBox "File C:\COMMAND.COM trovato" End Sub |