Option Explecit ' 共通処理モジュール ' パス名からファイル名を取得 Public Function getFileName(aPath As String) As String Dim i, l_all As Integer Dim c As String Dim result As String l_all = Len(aPath) getFileName = "" For i = l_all To 1 Step -1 c = Mid(aPath, i, 1) If c = "\" Then If i < l_all Then getFileName = Right(aPath, l_all - i) End If Exit For End If Next i End Function