Runtime Error 7: Out of Memory [Fix]
Get rid of your temporary files to create space
5 min. read
Updated on
Read our disclosure page to find out how can you help Windows Report sustain the editorial team. Read more
Key notes
- Runtime error 7 out of memory message indicates that your computer is out of memory.
- This can occur when you have a large number of programs running at the same time or when you have too many files open.Â
- The first thing to do is to close some programs or quit those that are open in the background.
Runtime error 7 out of memory is a common error every programmer faces at least once in a lifetime. Other computer users are also not exempt from this error, as it appeared when using Microsoft Excel.
You might get this error if you’re working on large projects using too much memory. A run repair tool should suffice, but even such requires memory to be installed, which is a memory issue. If a repair tool is out of the picture, find other ways to deal with this error.
What is the run time error 7 in Excel?
Run time error 7 is common in Excel. It occurs when the program runs out of memory. This can happen if you work with a large spreadsheet or have many spreadsheets open simultaneously.
It may also occur when you try to run a macro you have written, but when you execute it, it fails because your system lacks sufficient resources.
Other reasons you may encounter the runtime error 7 out of memory include:
- Corrupt file – Sometimes, when you open an Excel file, it may not open properly because it has become corrupt for some reason.
- Insufficient memory – Your computer needs enough space to store files and ensure that all applications run smoothly without interruptions or crashes due to insufficient memory resources.
- Compatibility issues – Another common cause of this error is an incompatibility between the version of Excel you are using and the version of the file you are trying to open.
- Unexpected closure of a workbook – You may also get this error if you close an Excel workbook without saving changes. When this happens, Excel tries to run the macro using objects that no longer exist.
- Memory leak – A memory leak occurs when a program allocates memory from the system and fails to free or reuse it. If you have an Excel file with a large number of formulas and functions, it’s possible that there is a memory leak.
- Hardware failure – The problem may also be caused by an issue with your computer’s hardware. Your CPU might be failing and causing this error.
Strangely enough, one of our readers encountered this error when one of the cells in the spreadsheet had an apostrophe (King’s Lynn). Removing the character returned everything to normal.
How can I fix the runtime error 7 out of memory?
Start off with these basic workarounds before jumping onto the heavy hitters:
- Close all unnecessary applications that are eating up your memory.
- Delete all temporary files from your PC.
- If you have recently installed any new software on your computer, try uninstalling it and see if that fixes the problem.
- Check your workbook for any errors and eliminate any typos.
- Perform a driver cleanup to get rid of unnecessary drivers.
- Restart your PC.
1. Defragment your hard disk drive
- Right-click on the Start Menu to bring up the shortcut menu, then select Windows Terminal (Admin).
- Type the following command, then hit Enter to analyze your drive. Remember to replace X with the letter of your drive:
defrag X: /a
- After the scan is finished, you’ll see information about your hard drive, including the fragmentation level and a note saying whether you need to defragment your drive or not.
- Now enter the following command to defrag that drive:
defrag X:
- Wait for the process to finish.
2. Increase Virtual Memory
- Hit the Search icon on the Taskbar, type View advanced system settings in the text field at the top, and click on the relevant search result that appears.
- In the Advanced tab, click on the Settings button under Performance.
- Navigate to the Advanced tab in the Performance Options window.
- Next, click on Change under Virtual memory.
- Untick the checkbox for Automatically manage paging file size for all drives.
- If Windows was managing the virtual memory earlier, it’s best to clear the previously set value and then increase it.
- To do that, click on the drive with System managed listed, select No paging file, and click on Set.
- Click Yes on the confirmation prompt that pops up.
- Now, choose a drive or partition from the list, select the Custom size option and enter the same value under Initial size and Maximum size fields in MB (1GB=1024MB), taking cue from the previous section.
- Once done, click on Set and then on OK at the bottom to save the changes.
- Next, restart the computer for the changes to come into effect.
Should the above steps fail to yield the expected results for runtime error 7 out of memory, upgrading your RAM would be next.
But before you’re quick to get a new one, do your due diligence first. Sometimes, you may find that Windows is not using all RAM or even with two RAM sticks, only one RAM slot is working.
Exhaust all avenues before replacing any components of your PC. We all know nothing comes cheap.
That’s it for this article, but if you have any other solution worth mentioning, let us know in the comment section below.
User forum
1 messages