Public Function GetFileExtension(strFileName As Variant) As String
Dim strTemp As String
Dim strTemp2 As String
Dim intPos As Integer
If IsNull(strFileName) Then
strTemp = " "
Else
strTemp2 = strFileName
intPos = InStrRev(strTemp2, ".")
If intPos = 0 Then
strTemp = " "
Else
If intPos = Len(strTemp2) Then
strTemp = " "
Else
strTemp = Mid(strTemp2, intPos + 1)
End If
End If
End If
GetFileExtension = strTemp
End Function