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
|