check for excel workbook

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

how do i check to see if an excel book is in a folder?

i am automating a process for non technical users and if a workbook exists,
i want to delete so they do not have to respond to the message already exists.

i am using a generic workbook during the update process as a work area


thanks for your help
 
Assuming the full path to the file is in variable strFilePath

If Len(Dir(strFilePath) > 0 Then
' File exists: delete it
Kill strFilePath
Else
' File does not exist
End if
 
thanks much

Douglas J. Steele said:
Assuming the full path to the file is in variable strFilePath

If Len(Dir(strFilePath) > 0 Then
' File exists: delete it
Kill strFilePath
Else
' File does not exist
End if
 
Back
Top