The Runtime error 7 is caused by a conflict inside Visual Basic encoded programs. If you try to open the BoundText property of a Data Combo in Visual Basic code after you scroll down the list of elements in its list portion until the currently selected element is no longer listed, the following error message may be displayed:
Runtime Error “7”: Out of Memory
Although the error message has appeared, you may find that there is no actual loss of memory and the system behaves consistently. To fix this error, you should follow the steps below:
What Causes Runtime Error 7?
Runtime Error 7 normally shows in this format:
Runtime Error “7”: Out of Memory
The error message above is caused by the FM20.dll file being corrupted or damaged. The FM20.dll file is used by Visual Basic to help encode various features and settings inside the programs you create. This file is only used within Visual Basic, and the reason why it shows errors is thanks to the way it is not supported by Visual Studio or other programming interfaces on your system. Fortunately, you can fix the Runtime Error 7 by removing the FM20.dll file from your application and then unregistering the comctl32.ocx file on your PC. Here’s what you should do…
How To Fix Runtime Error 7
Step 1 – Remove the FM20.dll file From Your Application
If you have coded a program using Visual Basic to use the FM20.dll (Dynamic Link Library) file then you should remove it, the reason being is that it might cause some conflictions. A DLL file is a file that contains different functions, which are mostly used across multiple applications and sometimes these can brake causing one of the applications to show error messages. To remove DLL files here’s what to do:
1. Open the Command Prompt.
- Click Start > Run.
- Type ‘cmd‘ in the box (without the quotation marks).
- Click OK.
2. Navigate to the exact location of the DLL.
- Type ‘regsvr32 /u fm20.dll‘ (again without quotations).
- Press Enter.
- Once you press enter a confirmation box will appear acknowloging that the process was successful.
Step 2 – Unregister And Delete “Comctl32.ocx” File
Comctl32.ocx is an essential file used by Windows to control various Visual Basic components on your PC. Unfortunately, this file often becomes damaged, leading Windows to show the Runtime 7 error. The most effective way to ensure this does not cause any errors, is to delete the file and re-register it on your PC. Here’s what to do:
1. Open the command prompt
- Click Start > Run
- Type the following command without quotations: ‘regsvr32 -u comctl32.ocx‘
- If you get a message saying ‘DLL is not registered’ press OK.
2. Search Files
- Click Start > then click Search.
- Click All files and folders.
- Type Comctl32.ocx in the All or part of the file name box.
- Select Local Hard Drives from the Look in drop down list.
- Click Search. Results will show in right hand pane.
- Make a note of the folder in which the Comctl32.ocx is i > right click the Comctl32.ocx file and delete it
Step 3 – Manually Replace The Comctl32.ocx File
It’s often the case that Comctl32.ocx will either be corrupted, damaged or just not have the necessary permissions for use on your system. If this is the case, then manually replacing the file could fix the error for you. Here’s what you need to do:
2) Unzip the Comctl32.ocx file onto your computer’s hard drive
3) Browse to c:\Windows\System32
4) Locate the current Comctl32.ocx on your system
5) Rename the current Comctl32.ocx to Comctl32BACKUP.ocx
6) Copy & paste the new Comctl32.ocx into C:\Windows\System32
7) Click Start > Run (Or search”run” on Vista & Win7)
8 ) Type “cmd” in the box that appears
9) Type “regsvr32 Comctl32.ocx” on the black screen
10) Press enter
11) Reboot your PC
Step 4 – Clean Out Viruses
Antivirus programs are software tools which scan through your PC and remove any of the viruses or malware infections that are on your system. It’s often the case that viruses will infect various DLL files on your computer and then cause them to be unreadable to your PC. To ensure this is not happening on your computer, you should try using an antivirus program to scan through your system and remove any of the infections that cause all these errors. You can download our recommended antivirus program from the link above, but there are a large variety of programs available.
Step 5 – Clean Out The Registry
Another big cause of the Runtime Error 7 errors is the registry database of Windows. The “registry” is a central database which stores all the settings, information and options for your computer, and is where Windows keeps many vital settings that it requires to run. It’s often the case that a lot of registry settings become damaged and corrupted, leading your PC to take longer to run, making it run slower and with a lot of errors. To fix this problem, you should use a ‘registry cleaner’ to scan through your PC and fix any of the damaged or corrupt settings that are inside it. You can see our recommended registry cleaner below: