G
Guest
I am having a problem with the Kill Statement to delete files. Sometimes it finds the files and sometimes it does not. I am missing something in this macro? Is there a better way to delete files?
Thanks in advance for your help!
Here is the macro:
Private Sub CmdDelete_Click()
Dim path As String
path = ActiveWorkbook.Worksheets("4").Range("C1")
If TxtFileDelete.Text <> TxtReEnterfiletoDelete.Text Then
MsgBox ("File Name mismatch, please re-enter")
Else
ActiveWorkbook.Worksheets("4").Range("C1").Value = TxtReEnterProjtoDelete.Value
Kill (path)
End If
End Sub
Thanks in advance for your help!
Here is the macro:
Private Sub CmdDelete_Click()
Dim path As String
path = ActiveWorkbook.Worksheets("4").Range("C1")
If TxtFileDelete.Text <> TxtReEnterfiletoDelete.Text Then
MsgBox ("File Name mismatch, please re-enter")
Else
ActiveWorkbook.Worksheets("4").Range("C1").Value = TxtReEnterProjtoDelete.Value
Kill (path)
End If
End Sub