K
Kathy Webster
I want to delete all files in a folder, and only error show the error
message if one or more of these files happens to be locked for any reason.
Unfortunately, this code is showing error message even when the folder is
empty, not when there is really a problem with deleting one of the files:
Public Function kill_tempfiles() As Boolean
On Local Error GoTo Err
Dim x As String
x = "K:\tempfiles\*.*"
Kill x
Exit Function
Err:
' MsgBox "We are sorry, but there is a problem with one or more of the
temp files in your temp file folder."
End Function
Thanks in advance.
message if one or more of these files happens to be locked for any reason.
Unfortunately, this code is showing error message even when the folder is
empty, not when there is really a problem with deleting one of the files:
Public Function kill_tempfiles() As Boolean
On Local Error GoTo Err
Dim x As String
x = "K:\tempfiles\*.*"
Kill x
Exit Function
Err:
' MsgBox "We are sorry, but there is a problem with one or more of the
temp files in your temp file folder."
End Function
Thanks in advance.