
Another Way to Delete Files or Filetypes
This routine uses all the good stuff that FileSystemObject offers. Here it is: Public Sub DeleteFiles(ByVal strPath As String, ByVal strExtension As String) Dim fsoMain As Scripting.FileSystemObject Dim folToDeleteFrom As Scripting.Folder Dim fleToDelete As Scripting.File On Error GoTo ErrorHandler ‘ Init Set fsoMain = New FileSystemObject ‘ Check if folder