ファイルパスからフォルダパスを取得
ファイルパスからフォルダパスを抽出します。
Option Explicit
MsgBox fnGetFolderPathByFilePath("C:\abc\test.txt")
Function fnGetFolderPathByFilePath(ByVal strPath)
Dim lIdx
Dim strName
lIdx = InStrRev(Replace(strPath,"/","\"), "\")
If lIdx > 0 Then
strName = Left(strPath, lIdx)
Else
strName = strPath
End If
fnGetFolderPathByFilePath = strName
End Function