Public Function GetFileNameFromPath(path As String) As String
Dim fileName As String
fileName = Dir(path)
If Len(fileName) > 0 Then
GetFileNameFromPath = fileName
Else
GetFileNameFromPath = "File not found"
End If
End Function
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