by Kenneth G. Jarvis, CPA (2 Submissions)
Category: Files/File Controls/Input/Output
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Thu 19th August 1999
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Returns a string specifying File name without path and extension
On Error GoTo Error_Handler
Dim lngBegin As Long
Dim lngToRight As Long
lngBegin = VBA.InStr(1, VBA.StrReverse(strSource), "\", vbTextCompare)
lngToRight = VBA.InStr(1, VBA.StrReverse(strSource), ".", vbTextCompare)
GetFileNameWOExt = VBA.Left(VBA.Right(strSource, lngBegin - 1), lngBegin - lngToRight - 1)
Exit Function
Error_Handler:
GetFileNameWOExt = ""
End Function
No comments have been posted about Returns a string specifying File name without path and extension. Why not be the first to post a comment about Returns a string specifying File name without path and extension.