When you open a file in Excel, you get an message that the file name extension doesn't match the actual file format. For example, the file has an .xlsx file name extension but it's really a text file and should have a .txt file name extension.
Before you click Yes to open the file, you may want to consider the reasons why the file might have an incorrect file name extension.
The file might have been:
Renamed inadvertently If you or someone you know renamed the file by accident with an incorrect file name extension, you can safely open the file. Then, save the file in the file format with the appropriate file name extension.
Renamed intentionally If you or someone you know purposely renamed the file with a different extension to ensure that Excel will recognize the file name extension, you can open the file. However, as a best practice, you should save the file with a file name extension that reflects its actual file format.
As a first step, however, it's important to decide whether or not you trust the source of the file. If you can't verify that the originator of the file is a trusted source, you shouldn't open the file. A hacker (malicious user) might have renamed the file with the intent of misleading you to open it in Excel.
An issue with a file name extension might occur when a workbook that you are trying to open is unreadable and the contents no longer resemble the expected file format. If a workbook has become corrupted, you can try to repair it before you open it. For information about how to recover a corrupted workbook, see Repair a corrupted workbook.
If you see this message when you try to open a workbook that a trusted source sent to you in an email, you can't open it from your email program. Ask the person who sent it to you to resend the workbook in the Excel Binary Workbook (*.xlsb) or Excel 97-2003 Workbook (*.xls) file format. Alternatively, you can save the attached workbook on your computer, and then open it in Excel.