Function RemoveExtension(aFilename As String) As String
'--- 拡張子の位置 ---'
Dim posExt As Long
posExt = InStrRev(aFilename, ".")
'--- 拡張子を除いたパス(ファイル名)を格納する変数 ---'
Dim strFileExExt As String
If (0 < posExt) Then
RemoveExtension = Left(aFilename, posExt - 1)
Else
RemoveExtension = aFilename
End If
End Function