20 | 09 | 2017

Get Pathname From File

You have a filepath including the filename but you only need the path without the name. The path can beĀ 

Function GetPathName(strFile As String) As String

'return the path for a file (folder only)
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
GetPathName = fso.GetParentFolderName(strFile)

End Function

Sign up now and upload your code to the website.

Help us to continue.....
Articles View Hits
Latest Articles