View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
merjet merjet is offline
external usenet poster
 
Posts: 812
Default Macro in Excel using an Array to Delete File in Directory if it Exists

Could you just replace:
Files(sDir).Select
If CreateObject .... Then
Kill MyPath & sDirectory
Else
End If
with: Kill MyPath & sDirectory
and before the For ...Next loop put:
On Error Resume Next

Hth,
Merjet