Originally Posted by
gmayor
Check the last few characters e.g
If Right(UCase(objAtt.FileName), 4) = ".XLS" Then
Hello,
Thanks for your reply. I tried the above code but it still grabs the .XLSX, perhaps because if it checks for the last 4 characters to be .XLS, the .XLSX also contains .XLS hence it grabs the .XLSX
I was thinking of doing sort of a MatchCase if possible or an If statement to do nothing (Exit Sub) on .XLSX
Edit: Tried this for the MatchCase but didn't work
If Dir(stFileName) = "" Then
If UCase(objAtt.DisplayName) = ".XLS" and UCase(objAtt.DisplayName) <> ".XLSX" Then
If InStr(objAtt, "Media") > 0 Then
objAtt.SaveAsFile saveFolder & objAtt.DisplayName
End If
If InStr(objAtt, "Media") > 0 Then
objAtt.SaveAsFile saveFolder & objAtt.DisplayName
End If
End If