check for excel workbook

J

jnewl

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
 
D

Douglas J. Steele

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
 
J

jnewl

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
 
Top