Excel "Files from the Internet can contain viruses": fix it
Excel opened the file in Protected View, a read-only mode. It does this because Windows marked the file as downloaded from the internet or received as an email attachment. If you trust the sender, click Enable Editing in the yellow bar. To stop it happening every time for that file, right-click the file, choose Properties, tick Unblock on the General tab and click OK.
What this message means
The yellow bar is not an error, and it does not mean the file is infected. Windows adds a hidden tag called the Mark of the Web (a Zone.Identifier stream) to files saved from a browser or an email. When Excel sees that tag, it opens the workbook in Protected View. This is a sandboxed, read-only mode where macros, external links and data connections cannot run, and editing and saving are disabled. The yellow bar comes back every time you open the file until the tag is removed or the file sits in a trusted location. Protected View is a feature of Excel for Windows. Excel for Mac and Excel on the web do not show this bar.
Common causes
| Cause | How to tell |
|---|---|
| The file was downloaded with a web browser (Edge, Chrome, Firefox) or saved from a web page. | The file is in your Downloads folder, and Properties > General shows the text "This file came from another computer and might be blocked to help protect this computer" next to an Unblock checkbox. |
| The file was saved from an email attachment, or opened straight from one. | The bar says "Be careful, email attachments can contain viruses" when the file is opened from Outlook. After you save the attachment to disk, it shows the internet wording. |
| The file came from a web location Windows treats as the Internet zone. Examples are a SharePoint or OneDrive link downloaded in a browser, a company web app export, or a network share opened by IP address. | Files you create yourself open normally, but every export from one particular site or share opens in Protected View. |
| The file was extracted from a downloaded ZIP. Windows copies the Mark of the Web onto every file inside it. | Every workbook from the same unzipped folder shows the bar. The ZIP file's own Properties also shows the Unblock checkbox. |
| A batch script, sync tool or third-party app copied files together with their Zone.Identifier stream. This makes local files look like they came from the internet. | Files you made yourself on your own drive show the internet warning. Running notepad "file.xlsx:Zone.Identifier" in Command Prompt shows ZoneId=3. |
How to fix it
1. Click Enable Editing (only if you trust the file)
Excel for Microsoft 365, 2024, 2021, 2019 and 2016 on Windows 10 and Windows 11
- Check that you expected this file and know who sent it. Unexpected invoices, payment notices and "shared document" emails are common malware lures.
- Click Enable Editing on the right side of the yellow bar.
- If a second bar appears saying SECURITY RISK Microsoft has blocked macros from running, do not look for an Enable Content button. It does not exist for internet files. Use the Unblock fix below instead.
- Save the file with File > Save As if you want an editable copy. The yellow bar may still appear the next time you open the original.
2. Unblock the individual file so it opens normally from now on
Windows 10 and Windows 11 (NTFS drives only)
- Close the workbook in Excel.
- In File Explorer, right-click the file and choose Properties. On Windows 11 you can also select the file and press Alt+Enter.
- On the General tab, at the bottom next to Security, tick Unblock.
- Click OK, then open the file again. The Protected View bar should be gone.
- If the file came out of a ZIP, unblock the ZIP file first and then extract it again. That way all the files inside come out unblocked.
3. Unblock many files at once with PowerShell
Windows 10 and Windows 11
- Open Windows PowerShell or Terminal. No administrator rights are needed for your own files.
- To unblock one folder, run: Get-ChildItem "C:\Users\YourName\Downloads\Reports" | Unblock-File
- To include subfolders, add -Recurse after the folder path.
- Reopen the files in Excel. Unblock-File removes the Zone.Identifier tag, which is the same as ticking Unblock in Properties.
4. Make a trusted location for files you regularly receive
Excel for Windows
- In Excel, go to File > Options > Trust Center, then click Trust Center Settings.
- Select Trusted Locations in the left pane and click Add new location.
- Click Browse, choose a folder you control (for example C:\Users\YourName\Documents\Trusted Reports), and tick Subfolders of this location are also trusted if you need them.
- Click OK until all dialogs close, then restart Excel.
- Save or move trusted files into that folder. They will open without Protected View and with macros enabled, so keep untrusted downloads out of it.
5. Open SharePoint or OneDrive files in the desktop app instead of downloading them
Microsoft 365 with OneDrive or SharePoint (including Teams files)
- In the browser, open the file in Excel for the web.
- Select Editing > Open in Desktop App, or use the Open in app option on the file.
- Alternatively, sync the library with the OneDrive client. Files the sync client downloads, and files in synced Desktop and Documents folders, do not get the Mark of the Web.
6. Turn off Protected View for internet files (last resort)
Excel for Windows. May be locked by your organization's policy.
- In Excel, go to File > Options > Trust Center > Trust Center Settings > Protected View.
- Clear Enable Protected View for files originating from the Internet.
- If local files show the warning for no clear reason, you can instead clear Enable Protected View for files located in potentially unsafe locations.
- Click OK and restart Excel.
- This lowers your protection for every downloaded file. Unblocking files or using a trusted location is safer. Leave Enable Protected View for Outlook attachments turned on.
Next time, skip the search
Crade is an AI assistant for Mac and Windows that sees your screen. When a message like this pops up, ask “what does this mean?” and it explains the exact error in front of you, step by step.
Download CradeStill not fixed?
If the options in Trust Center > Protected View are greyed out, your organization manages them through Group Policy or Intune, and only your IT administrator can change them or add a trusted site. If Unblock is missing or does nothing, the file is probably on a network share or FAT32/exFAT drive, or its location is in the Internet zone. Copy it to a local NTFS folder (such as Documents) and unblock it there, or ask IT to add the share to Trusted sites or Local intranet under Control Panel > Internet Options > Security. If even files you created yourself open in Protected View, check that Office is activated under File > Account and run a Quick Repair from Settings > Apps > Installed apps > Microsoft 365 > Modify.
Questions people ask
Is it safe to click Enable Editing?
It is safe if you trust the source and were expecting the file. Protected View blocks macros and external content while the file is read-only. Enable Editing removes that sandbox, so do not click it for unexpected attachments or files from unknown senders.
Why do all my Excel files open in Protected View, even ones I made?
The files usually carry a Mark of the Web, copied over from a download, a ZIP, or a sync or backup tool. Unblock them with Properties > Unblock or with PowerShell's Unblock-File, or put them in a trusted location.
How do I stop Excel from opening downloaded files in Protected View?
For individual files, tick Unblock in the file's Properties. For a folder you receive files into regularly, add it under File > Options > Trust Center > Trust Center Settings > Trusted Locations. Turning off Enable Protected View for files originating from the Internet also works, but it removes the protection for every download.
Why is the file still read-only after I click Enable Editing?
The workbook may be marked as final, have protected sheets (Review > Unprotect Sheet), be open by someone else, or be opened from a read-only folder or a ZIP you have not extracted. Extract ZIP contents first and save a copy to a folder you can write to.
Does Excel for Mac show this Protected View message?
No. Protected View and the Mark of the Web check are Windows features. On a Mac, macOS Gatekeeper and Excel's own macro warnings handle downloaded files.
Sources
- What is Protected View? (Microsoft Support)
- Macros from the internet are blocked by default in Office (Microsoft Learn)
- Add, remove, or change a trusted location in Microsoft Office (Microsoft Support)
- Office thinks all documents are from the internet (Microsoft Q&A)
- Excel #CALC! error: what it means and how to fix it
- Excel can't insert new cells (push non-empty cells off worksheet): fix
- Excel "There are one or more circular references": how to fix
- Excel #DIV/0! error: what it means and how to fix it
- Excel "file format or file extension is not valid": how to fix it
- Excel "file is locked for editing by another user": how to fix it