You’re seeing Excel crash with Runtime Error 7 ("Out of Memory") because your workbook or macro is too large for the available system resources. This happens when Excel tries to load too many formulas, references, or complex calculations simultaneously. The fix is straightforward: free up memory by simplifying workbooks, adjusting settings, or closing unused apps. Start with these steps to resolve it.
What You'll Need
- A working copy of Excel (Excel 2016 or later; Office 365/2019 handles large files better)
- Administrator rights to install updates or tweak system settings (if needed)
- A second monitor or workspace if your files are excessively large
- Backup your workbook first (File > Open > choose a backup location)
Step-by-Step
- Close all Excel instances and background processes. Open Task Manager (Ctrl+Shift+Esc) > go to the "Processes" tab > look for Excel.exe or "Microsoft Office" processes. End any lingering Excel tasks. Restart the computer if needed.
-
Reduce workbook complexity.
Open your workbook and simplify:
- Delete unused sheets (right-click sheet tabs > Delete). Keep only essential sheets.
- Remove or merge large tables; use Excel’s "Table" feature (Ctrl+T) instead of columns.
- Break complex formulas into smaller steps by adding intermediate columns or sub-formulas.
- Enable "Ignore external links" (Data > Get Data > From Other Sources > Convert > Ignore links).
- Disable add-ins and macros. Go to File > Options > Add-ins. In the "Manage" dropdown, check which add-ins are active. Disable all except essential ones (like Quick Access Toolbar). For macros, disable them via File > Options > Trust Center > Trust Center Settings > Macro Settings > select "Disable all macros with notification."
-
Enable Excel’s memory optimization.
Go to File > Options > Advanced and under "General," check:
- "Automatically calculate workbooks when opening" (uncheck this if formulas aren’t needed)
- "Use 64-bit version of Excel" (if available; check File > Account > Excel Options > Advanced > 64-bit mode)
-
Adjust display settings.
Go to File > Options > Display and reduce:
- Font size to 100% (default)
- Check "Display formula bars in landscape mode" (if using landscape)
- Use a smaller file format. Convert the workbook to .xlsx (Excel 2007+) instead of .xls (.xlsm for macros). Save as a new file and open the backup to test.
- Close other resource-heavy apps. Open Task Manager again (Ctrl+Shift+Esc) and end processes like Adobe Reader, antivirus software, or cloud sync tools (Google Drive, OneDrive). These compete for system memory.
- Try a lighter view mode. Hold the Alt key while opening Excel to launch in Excel Viewer mode (limited formula calculations). Press Enter to return to full view.
-
Enable virtual memory (if needed).
For PCs with limited RAM, increase virtual memory:
- Press Win+R, type sysdm.cpl and press Enter.
- Go to Advanced system settings > Performance > Advanced > Virtual Memory.
- Select Change and increase the custom size to 1.5× your available RAM (e.g., 4GB RAM = 6GB virtual memory).
If that did not work
- Reinstall Excel. Uninstall Excel from Control Panel > Programs > Uninstall a Program. Reinstall the latest version from the Microsoft Store or official site.
- Repair Office installation. Open Control Panel > Programs > Programs and Features > Microsoft 365 Products > Change > Quick Repair.
- Check for corrupt files. Open Excel, press Ctrl+Alt+F12 to open the VBA editor. Close all modules, then restart Excel. If it resolves, the workbook is corrupted.
Common Mistakes
- Opening multiple Excel files simultaneously. Each open instance consumes RAM. Close unused files or use a single instance with multiple monitors.
- Using large Excel files in cloud services. Cloud sync (OneDrive, Google Drive) can double memory usage. Download files locally instead.
- Ignoring add-ins or macros. Even harmless macros can trigger the error if they reference external data. Disable all add-ins first.
- Skipping system updates. Older versions of Excel lack memory optimization features. Ensure you’re using the latest update (File > Account > Office Updates).
Tips
- Use Excel’s "Save As" to test. Open an empty workbook and save the broken file as a new name. If it runs, the original is likely corrupted.
- Limit workbook size. For files over 100MB, consider splitting them into smaller sheets or using Power Query for large data sets.
- Monitor RAM usage. Use Task Manager (Ctrl+Shift+Esc) to check if Excel is using more than 90% of RAM. If so, close other apps.
- Avoid VBA loops in large datasets. Replace loops with PivotTables or formulas like `=INDEX(Array, ROW())` for faster performance.
- Enable "Show All Calculations" (File > Options > Formulas > "Show all calculations"). This forces Excel to recalculate slowly but avoids memory spiking.
Troubleshooting
- Excel freezes or crashes repeatedly. Test with a minimal workbook: open Excel, go to Formulas > Named Ranges, delete all names. If it runs, the issue stems from named ranges or macros.
- Error persists after disabling add-ins. Try opening the file in Excel Online or a lighter app like Google Sheets. If it works, the problem is file-specific (corruption, macros).
- PC becomes sluggish after fixing. Revert changes (e.g., virtual memory increase) and check for background apps (Windows Services or Task Manager). Disable unnecessary services like "Windows Search."
- Multiple users report the error. Ensure all users are using the latest Excel version. Check for shared file corruption by creating a new user profile (Control Panel > User Accounts > Manage other users > Delete profile).
Frequently Asked Questions
How do I tell if my Excel file is too large?
Files over 1GB may trigger "Out of Memory" errors. To check, open the file in Excel, go to File > Info > Document Properties > Details. Look for "Size:"—files over 200MB often need optimization.
Can I force Excel to use more RAM?
No, Excel cannot dynamically allocate more RAM. Instead, increase virtual memory (as shown above) or free up physical RAM (close apps like browser tabs or antivirus tools).
Why does Excel crash when opening a file but work in Excel Viewer?
The Viewer mode bypasses heavy calculations (like PivotTables or VBA). The crash suggests the file contains complex formulas, macros, or external links. Disable add-ins first.
How do I prevent Excel from crashing in the future?
Use these habits:
- Always back up files before edits.
- Limit named ranges to 100+—use PivotTables instead.
- Enable "Calculate on exit" (File > Options > Formulas) to auto-calculate before closing.
- Use "Save As" to test files incrementally.
Is there a way to "reset" Excel’s memory usage?
Yes. Restart Excel in safe mode:
- Close all instances of Excel.
- Open File Explorer, navigate to:
C:\Program Files\Microsoft Office\Root\Document Protection\ - Delete the folder named after your Excel version (e.g., "16.0_15022101" for Excel 2019). Restart Excel.
This resets settings without losing data.
Why does disabling macros not help?
If the error persists after disabling macros, the issue may stem from:
- A corrupted workbook (try opening in a new file).
- A custom formula referencing external data (check for `#REF!` errors).
- A macro referencing a deleted sheet or object (verify file integrity).
Check for `#NAME?` errors in formulas—they can cause memory spikes.
Can I use a lighter version of Excel for large files?
Yes. Try Excel for Mac (lighter on Windows PCs) or Google Sheets:
- For cloud-hosted files, use Google Sheets (supports 10MB+ files).
- For on-premise, use Lightweight Excel (LTX) or LibreOffice Calc (free, but lacks VBA).