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
Posted inโค้ด