I have been using every version of Kill routines to delete xls files in the current directory with no success. Here is my code. I want to delete every xls file except wbCntl. Stepping through this code shows that everything works with the exception of the Kill swb command. (swb is public defined as a string)
'Close all files except wbCntl
swb1 = wbCntl.Name
For Each wb In Application.Workbooks
swb = wb.Name
If swb <> swb1 Then
Workbooks(swb).Close SaveChanges:=False
On Error Resume Next
Kill swb
Err.Clear
End If
Next wb
Can anyone help me with this