Excel "Privacy warning: This document contains macros": fix
Excel shows this warning when you save a workbook that has macros or ActiveX controls and also has the per-file option "Remove personal information from file properties on save" turned on. Nothing is broken and the file still saves. To stop it, go to File > Options > Trust Center > Trust Center Settings > Privacy Options and uncheck that box, then save.
What this message means
The workbook has a document-specific privacy flag switched on that tells Excel to strip your name and other personal details from the file properties every time you save. Excel can clean the file properties, but it cannot inspect or clean VBA code, ActiveX controls, XML expansion packs or Web components. So on each save it warns you that personal information might remain in those parts. Clicking OK saves the file normally. The warning is informational, not a security block, and it is not caused by your macro security level. It keeps returning because the flag is stored inside that particular workbook (or the template it was created from).
Common causes
| Cause | How to tell |
|---|---|
| Document Inspector was run on the workbook and "Document Properties and Personal Information" was removed | The warning started after someone used File > Info > Check for Issues > Inspect Document and clicked Remove All. File > Info now shows no Author or Last Modified By name. |
| The "Remove personal information from file properties on save" box is checked for this workbook | In File > Options > Trust Center > Trust Center Settings > Privacy Options, the box under "Document-specific settings" is ticked. Other workbooks without macros save silently. |
| The workbook was created from a template (.xltm or .xltx) that carries the flag | Every new file made from the same template shows the warning on first save, even after you fix one copy. |
| A VBA macro or add-in sets Workbook.RemovePersonalInformation to True | You untick the box, but the warning comes back after a macro runs. Searching the VBA project (Alt+F11, then Ctrl+F) finds "RemovePersonalInformation". |
How to fix it
1. Turn off the per-file privacy option in the Trust Center
Excel for Microsoft 365, 2024, 2021, 2019, 2016 on Windows 10 and 11
- Open the workbook that shows the warning.
- Go to File > Options > Trust Center and click Trust Center Settings.
- Select Privacy Options in the left pane.
- Under "Document-specific settings", uncheck "Remove personal information from file properties on save".
- Click OK twice, then save the workbook (Ctrl+S). The warning should not appear on this or later saves.
2. Use the shortcut through the Developer tab
Windows Excel with the Developer tab enabled
- Click Developer > Macro Security. This opens the Trust Center directly.
- Select Privacy Options.
- Uncheck "Remove personal information from file properties on save" under Document-specific settings.
- Click OK and save the workbook.
3. Fix the template the workbooks come from
- In Excel, go to File > Open > Browse and open the template file itself (.xltm or .xltx), not a new copy of it.
- Go to File > Options > Trust Center > Trust Center Settings > Privacy Options.
- Uncheck "Remove personal information from file properties on save" and click OK.
- Save and close the template. New workbooks created from it will no longer carry the setting.
- Open any workbooks already made from the old template and turn the option off in each one (fix 1).
4. Clear the flag with VBA (useful for many files or when the box is greyed out)
Macro-enabled workbooks (.xlsm, .xlsb, .xltm) on Windows or Mac
- Open the workbook and press Alt+F11 (Mac: Option+F11 or Tools > Macro > Visual Basic Editor).
- Press Ctrl+G to open the Immediate window.
- Type ThisWorkbook.RemovePersonalInformation = False and press Enter.
- Search the project (Ctrl+F, "Current Project") for RemovePersonalInformation and remove or change any line that sets it to True.
- Close the editor and save the workbook.
5. Turn off the option on a Mac
Excel for Mac (Microsoft 365, 2021, 2024)
- Open the workbook.
- Choose Excel > Settings (called Preferences on older macOS/Office versions).
- Open Security (shown as Security & Privacy in some versions).
- Uncheck "Remove personal information from this file on save", close the window and save the file.
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 checkbox is greyed out or keeps switching back on, your organisation may control it through Group Policy or Intune, or an add-in may be resetting it. Try opening Excel in safe mode (hold Ctrl while starting it, or run excel /safe) and change the setting there. If it still returns, copy the sheets and VBA modules into a brand-new workbook made from the blank template, then save that. On a managed work PC, ask IT whether an Office privacy policy is applied. The warning itself is harmless, so clicking OK is always a safe option.
Questions people ask
Is it safe to click OK on this privacy warning?
Yes. The file saves normally. The message only tells you that your name or other personal details might still be inside the macros or controls, because Document Inspector cannot clean those parts.
Why does the warning appear every time I save?
The "Remove personal information from file properties on save" option is stored inside the workbook, so Excel checks it on every save. Untick it in Trust Center > Privacy Options for that file and the warning stops.
Will changing macro security settings stop the warning?
No. Enabling all macros or ActiveX controls does not affect this message and weakens your protection against malicious files. The privacy option under Privacy Options is what controls it.
Can I suppress the warning with VBA instead?
Setting Application.DisplayAlerts = False before a Save in code hides it for that save only. Setting ThisWorkbook.RemovePersonalInformation = False removes the cause permanently.
If I turn the option off, will my name be saved in the file?
Yes, Excel will again store the author and last-saved-by names in the file properties. If you need to remove them before sharing, run File > Info > Check for Issues > Inspect Document on a copy of the file.
Sources
- View my privacy options in Microsoft Office (Microsoft Support)
- Remove hidden data and personal information by inspecting documents, presentations, or workbooks (Microsoft Support)
- Workbook.RemovePersonalInformation property (Excel) (Microsoft Learn)
- Privacy warning for Office Excel (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