vba ลบโฟลเดอร์กับไฟล์ข้างในทั้งหมด

Public Function DeleteFolder(ByVal folderPath As String) As Boolean
    On Error Resume Next
    Dim fso As Object
    Set fso = CreateObject("Scripting.FileSystemObject")
    If fso.FolderExists(folderPath) Then
        fso.DeleteFolder folderPath, True
        DeleteFolder = True
    Else
        DeleteFolder = False
    End If
    Set fso = Nothing
End Function
This entry was posted in โค้ด. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *