The right function only reads the last four characters. The last four characters of the xlsx file are xlsx and not .xls
It is easy enough to demonstrate. Select a message and run the test macro below
Sub Test()
Dim olMsg As MailItem
On Error Resume Next
Set olMsg = ActiveExplorer.Selection.Item(1)
CheckAttachments olMsg
lbl_Exit:
Exit Sub
End Sub
Sub CheckAttachments(olItem As MailItem)
Dim objAtt As Attachment
For Each objAtt In olItem.Attachments
MsgBox Right(UCase(objAtt.fileName), 4)
If Right(UCase(objAtt.fileName), 4) = ".XLS" Then
MsgBox objAtt.fileName
End If
Next objAtt
lbl_Exit:
set objAtt = Nothing
Exit Sub
End Sub