How to Fix Excel Cannot Find #N/A Error When Closing a Workbook
Question details
The user encounters a persistent error dialog stating 'Cannot find #N/A' every time they attempt to close an Excel workbook, even after clearing the Name Manager and attempting to remove macros.
- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Closing a workbook after viewing or editing spreadsheet data.
- Observed behavior
- Excel forcefully displays a 'Cannot find #N/A' warning whenever the file is closed, interrupting the normal shutdown process.
Verify that your workbook is saved locally on your hard drive rather than a synced cloud folder, as real-time cloud syncing can occasionally interfere with VBA shutdown events and trigger false reference errors.
Disable Add-ins and Save as an XLSX File
Background add-ins or legacy macro-enabled formats can cause hidden errors upon closing. Forcing a macro-free format clears these issues automatically.
Saving the file as a standard XLSX format strips out all remaining VBA macros and scripts. This is highly effective if the error stems from unneeded background code.
Go to File > Options > Add-ins. In the 'Manage' dropdown at the bottom, select 'COM Add-ins' and click 'Go'. Uncheck all add-ins to disable them and click OK.
Click on File > Save As and choose a local destination on your computer.
In the 'Save as type' dropdown, select 'Excel Workbook (*.xlsx)'. Confirm any prompts warning you that macros will be removed, then close the newly saved file to verify the error is gone.
Inspect the VBA Editor for Close-Event Macros
If your workbook must remain macro-enabled (.xlsm), you need to manually locate and remove the specific script triggering the error when the file closes.
Experience Error-Free Spreadsheets with WPS Office
If Microsoft Excel continues to display persistent VBA or legacy add-in errors like 'Cannot find #N/A', consider switching to WPS Office. It provides a lightweight, highly compatible spreadsheet tool that opens your existing files without triggering heavy legacy add-in conflicts.
- 1. Download and Install: Visit the official WPS website to download and securely install the free WPS Office suite on your device.
- 2. Open Your Workbook: Launch WPS Spreadsheet, go to File > Open, and select the Excel workbook that was previously causing errors.
- 3. Edit Without Interruptions: Enjoy editing and closing your spreadsheet files with full format compatibility and without legacy macro interruptions.

Frequently Asked Questions
Why does Excel show a 'Cannot find' error specifically when closing?
This typically occurs when a hidden macro (such as Workbook_BeforeClose) or a third-party Excel add-in attempts to execute a script as the file shuts down. If it tries to reference a missing cell or a deleted named range containing '#N/A', the error interrupts the closing process.
Does saving an Excel file as XLSX permanently delete its macros?
Yes, the standard .xlsx file format does not support VBA macros. Saving your file in this format strips out all custom scripts and background code, which is a highly effective way to permanently remove hidden code causing shutdown errors.
How do I ensure there are no '#N/A' errors in the Name Manager?
Navigate to the Formulas tab on the Excel ribbon and click 'Name Manager'. Look for any named ranges that display '#REF!' or '#N/A' in the 'Value' or 'Refers To' columns. Select those broken references and click 'Delete'.




