• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

delete file with any type of extension.

Hi pakilpropgramador

Give the following a try.

Code:
Sub GetRid()
    Kill "C:\Users\HYMC\Downloads\Test\*.*"
End Sub

Remember the \ at the end of the path.

Take care

Smallman
 
hi, deepak,

because, that folder contains thousands of important files with different extension.

so, for example thanks,
 

Attachments

  • example1.xlsm
    18.1 KB · Views: 4
Last edited:
So Pakilprogramador

Did you apply my suggestion? I figure applying my code is simpler than:

1. Finding the appropriate file
2. Deleting the whole fiolder
3. Creating a new file
4. Renaming the new file

The code should run perfectly on any file type.

Take care

Smallman
 
Code:
Private Sub eliminararchivos_Click()
  On Error Resume Next
    Kill "C:\reportes\*.xlsm"
    MsgBox "se elimino el achivo correctamente", vbInformation
    On Error GoTo 0
    End Sub

very well @Smallman thanks so much

regards,
 
Back
Top