หาชื่อไฟล์จาก path

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

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

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