Technology

How to Fix Runtime Error 339 in Windows: 6 Working Fixes

Runtime error 339 means Windows cannot find or load a file the program needs. The file is usually an OCX or DLL component that is missing, damaged, or not registered. The error mostly appears in older programs built with Visual Basic 6.

The error message often looks like this: “Component ‘MSCOMCTL.OCX’ or one of its dependencies not correctly registered: a file is missing or invalid.” The fixes below start with the quickest and safest.

What Causes Runtime Error 339?

The most common causes are:

  • Someone deleted the OCX or DLL file by mistake.
  • A virus or antivirus tool removed or quarantined the file.
  • A program installation failed or the file got corrupted.
  • The file exists but is not registered in Windows.

Fix 1: Run the Program as Administrator

Some programs need extra permission to load their components. Right-click the program’s shortcut and select Run as administrator. If the error disappears, you can set this option permanently in Properties > Compatibility.

Fix 2: Re-Register the File With regsvr32

This is the most reliable fix when the file exists but is not registered.

  1. Click Start, type cmd, right-click Command Prompt, and choose Run as administrator.
  2. Type the command below, replacing the file name with the one in your error message, and press Enter:
regsvr32 C:\Windows\System32\MSCOMCTL.OCX
  1. Wait for the message “DllRegisterServer succeeded”.
  2. Restart your computer and open the program again.

On 64-bit Windows, 32-bit components live in the SysWOW64 folder. Use this command instead:

C:\Windows\SysWOW64\regsvr32.exe C:\Windows\SysWOW64\MSCOMCTL.OCX

Microsoft explains this tool in its regsvr32 documentation.

Fix 3: Reinstall the Program

If the program caused the error, reinstalling often replaces the missing file and registers it correctly. Uninstall the program from Settings > Apps, restart your PC, and install it again using the original installer.

Fix 4: Restore the Missing File From a Safe Source

If the file itself is missing, get it from a trusted place:

  • The program’s original installer or setup disc
  • Microsoft’s official Visual Basic 6 runtime download
  • A working computer with the same Windows version and program

Do not download OCX or DLL files from random “free DLL” websites. These files can carry malware. After you copy the file into the correct folder, register it with Fix 2.

Fix 5: Run SFC and DISM

These built-in tools repair damaged Windows system files. Open Command Prompt as administrator and run:

sfc /scannow

When it finishes, run:

DISM /Online /Cleanup-Image /RestoreHealth

Restart your PC after both scans. See Microsoft’s SFC documentation for details. If you also see missing DLL errors, read our guide on msvcr120.dll not found.

Fix 6: Scan for Malware

A virus can delete or replace system files. Open Windows Security > Virus & threat protection and run a Full scan. Restore any file that your antivirus quarantined by mistake, then register it again.

Conclusion

Runtime error 339 is almost always a missing or unregistered file. Start with Run as administrator and regsvr32. If that fails, reinstall the program or repair Windows with SFC and DISM. Avoid unknown download sites and registry cleaners.

Is runtime error 339 a virus?

No. It is a missing or unregistered file error. A virus can cause it by deleting the file, so a malware scan is a good check.

Does this error affect Windows 11?

Yes. Older programs that use OCX files can trigger it on Windows 10 and 11.

Why does regsvr32 say “module not found”?

The file is not in the folder you typed, or you used the wrong folder for 32-bit files on 64-bit Windows. Check the path and try SysWOW64.

Show More

Raj Maurya

Raj Maurya is the founder of Digital Gyan. He is a technical content writer on Fiverr and freelancer.com. When not working, he plays Valorant.

Related Articles

Leave a Reply

Back to top button