Excel File Could Be Corrupted or Unsafe? What to Do

How-to basics · Updated November 21, 2026

Yes, an Excel file can be corrupted, unsafe, both, or neither: the warning alone does not prove which. If Excel says the file could be corrupted or unsafe, do not choose to open it until you have checked where it came from; if it is from a trusted source, try Excel’s repair options rather than weakening security settings.

What the warning means

Excel may display a warning such as “The file could be corrupted or unsafe. Unless you trust its source, don’t open it” when it cannot confidently treat a workbook as safe to open. The message is a precaution, not a diagnosis. It does not say that Excel found malware, and it does not confirm that the workbook is damaged.

Excel and Windows use several safeguards for files that arrive from the internet, email attachments, or other locations considered untrusted. Depending on the file and the version of Office, you may see a warning, a Protected View banner, or a prompt about a file format that does not match its extension. These are related security checks, but they are not the same message and do not have exactly the same cause.

Corruption means some of the workbook’s data or structure may be damaged—for example, a download stopped partway through, or a storage device had an error. Unsafe means the file or its contents may pose a security risk. A workbook can be structurally sound but unsafe, damaged but harmless, or simply unfamiliar to Excel.

Why Excel may show it

A warning can appear for several reasons. The source and circumstances matter more than the warning by itself:

  • The file came from an untrusted location. Email attachments, browser downloads, shared links, and network folders can receive additional checks because attackers sometimes distribute harmful Office files through those routes.
  • The download or transfer was incomplete. A partial file may have a normal-looking name but lack the data Excel expects. A network interruption, a full drive, or a failed copy can cause this.
  • The extension and actual format disagree. A file named with an .xlsx ending might not actually be an Excel workbook, or someone may have changed its extension. Renaming a file does not convert it.
  • The file contains active content. Macro-enabled workbooks, embedded objects, and links to external data can require extra caution. Their presence does not automatically mean a file is malicious, but an unexpected request to enable content deserves scrutiny.
  • A security tool or Office setting intervened. Protected View, file validation, or an organization’s security policy may block or warn about a file that Excel cannot verify.

Excel can also show other messages that sound similar. For example, “The file format and extension don’t match” points to a possible mismatch between the file’s contents and its name. “Excel cannot open the file because the file format or file extension is not valid” can arise from a bad extension, a non-Excel file, or damage. Read the exact wording before choosing a fix.

How to decide whether it is safe

Start by checking the file’s provenance. Did you expect it, and does the sender normally share this kind of workbook? If it arrived unexpectedly, ask the sender through a separate, known contact method whether they sent it. Do not reply to a suspicious email or use a phone number or link included in that message to verify it.

Look for signs that the file or delivery may be wrong: an unfamiliar sender, a surprising request to enable macros, a misspelled file name, a download from an unofficial site, or an attachment that does not fit the conversation. A familiar display name is not proof that the sender’s account is genuine. If the sender cannot confirm the file, delete it or report it according to your workplace’s security process.

On Windows, you can scan a downloaded file with Microsoft Defender before opening it. In File Explorer, right-click the file and choose Scan with Microsoft Defender; the exact menu can vary by Windows version. A clean scan is useful information, but no antivirus scan can guarantee that a file is harmless. Keep Windows and Microsoft 365 updated, and follow your organization’s security rules if the device is managed.

Safe steps to try first

If the file is expected and the source is verified, use a cautious sequence rather than turning off Excel’s protections:

  1. Get a fresh copy. Ask the sender to share the workbook again, or download it again from the official source. Compare the file size with any size the sender provides. If a new copy opens, the first copy may have been incomplete or damaged.
  2. Check the name and extension. Confirm that the sender intended to provide an Excel workbook. Extensions such as .xlsx and .xlsm identify different workbook types; .xlsm supports VBA macros. Do not rename a file to .xlsx just to make Excel accept it.
  3. Save it locally. If it came from a cloud or network location, first make sure the source is legitimate, then save a copy to a local folder. Do not use this step to bypass a warning on an untrusted file.
  4. Open it with Excel’s repair feature. In Excel for Microsoft 365 on Windows, choose File > Open > Browse. Select the workbook, click the arrow beside the Open button, and choose Open and Repair. Try Repair first; if that fails, use Extract Data to try to recover values and formulas.
  5. Ask for another format if needed. If you only need the tabular data, ask the sender for a fresh .xlsx copy or a CSV export. CSV keeps plain text values from one sheet, not workbook formatting, multiple sheets, macros, or formulas as working formulas.

For a file from the internet, Windows may show an Unblock option in the file’s Properties window. Only consider it after verifying the source and understanding that unblocking can remove a security restriction. Do not use it as a routine fix for files from unknown senders.

Using Protected View and enabling content

Protected View opens some files in a restricted mode, usually with a banner at the top of the workbook. If you trust the file and have confirmed its source, you can choose Enable Editing to work with it. That action should be based on trust in the actual document, not simply on wanting to make the warning disappear.

Be especially careful with Enable Content or prompts to enable macros. Macros can automate legitimate tasks, but malicious macros can also perform harmful actions. A workbook that unexpectedly asks you to enable macros to view ordinary data is a reason to stop and check with the sender. The .xlsx format does not store VBA macros, but that alone does not guarantee a workbook is safe: other content, links, or a deceptive file can still be risky.

Avoid turning off Protected View or lowering Trust Center protections globally just to open one attachment. In Microsoft 365 for Windows, settings are under File > Options > Trust Center > Trust Center Settings. Changing them can affect other files too, and a work or school administrator may control them. Excel for Mac has different settings and menus; do not assume Windows instructions apply exactly. Excel for the web also has a different opening experience, and using the web version does not make an untrusted file safe.

If Excel reports damage

When Excel says a workbook is corrupt, Open and Repair is the first built-in recovery option to try on a copy. Repair may restore the workbook structure, but it might not recover every item. Extract Data can prioritize values and formulas when a complete repair is not possible; formatting, charts, objects, or other features may be lost.

Protect the original before experimenting. Make a duplicate, and try recovery on the duplicate so you do not overwrite your only copy. If the file is on OneDrive or SharePoint, check whether an earlier version is available through the file’s version history. If you use a local backup system, restore a separate copy rather than replacing the damaged file immediately.

For a workbook that opens but appears incomplete, inspect the sheet tabs, formulas, and key totals against a reliable source. A successful opening does not prove that every part of the workbook was recovered correctly. If it contains important business or research data, ask the owner for a verified replacement before relying on repaired results.

Common mistakes to avoid

  • Clicking through every prompt. “Enable Editing” and “Enable Content” have different effects; understand what Excel is requesting before proceeding.
  • Changing the extension to force a match. This changes the label, not the file’s internal format, and can make diagnosis harder.
  • Assuming a scan settles the question. Scanning helps assess risk but does not establish that a file is safe or that it is intact.
  • Disabling security for all workbooks. A global change can expose you to future files you have not checked.
  • Saving over the only original. Keep an untouched copy until you have confirmed that any recovered workbook contains the data you need.

How to reduce future warnings

Use links from the sender’s official service rather than unexpected attachments, and keep a backup of important workbooks. Ask people who send you macro-enabled files to explain why macros are necessary and to provide files through an approved channel. When downloading from a website, check that the address is the genuine site and that the file type is what you expected.

In a workplace, follow the organization’s approved process for requesting access to a blocked workbook. An administrator may be able to verify the file or provide a safer copy. Avoid moving files into a trusted folder or changing security settings unless your IT team directs you to do so; trusted locations can reduce warnings, but they also change how files in those locations are treated.

Frequently Asked Questions

Does this warning mean the Excel file has a virus?
No. It means Excel has a reason to be cautious, not that it has confirmed malware. Verify the sender and source, and scan the file if appropriate, but remember that a scan cannot guarantee safety.

Can I open the file if I know who sent it?
Only if you also trust that the sender actually sent this particular file and the request makes sense. Sender names can be spoofed or accounts compromised. Confirm unexpected attachments through a separate, known channel before opening or enabling content.

Will Open and Repair remove the warning?
It may recover a damaged workbook, but it does not prove that the file is safe. Use it only after checking the source, and work on a copy. If Excel still warns you, do not treat successful repair as a security clearance.

Is an .xlsx file always safe?
No. .xlsx files do not store VBA macros, unlike .xlsm files, but an extension is not a safety guarantee. Files can be mislabeled, contain other risky content, or exploit software that has not been updated.

What if I need the data but do not trust the workbook?
Do not open it on your usual computer or enable its content. Ask the sender for a verified, plain-data export through a trusted channel, or contact your organization’s IT or security team for help. A CSV may be suitable for simple table data, but it does not preserve the full workbook.

Related

Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.

More in How-to basics

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.