When you see the error "Excel VBA Class Not Registered" while running a macro or opening a workbook, it means Excel cannot find or load a required COM object or ActiveX control referenced in your VBA code. This typically occurs after Windows updates, Office reinstallations, or when moving files between systems. The fix involves re-registering the missing or corrupted component, often related to Microsoft Office libraries or third-party add-ins. No external tools are needed—only administrative access and basic system commands.

What You'll Need

  • Administrative privileges on the Windows computer
  • Microsoft Excel installed (2010 or later)
  • Access to the Windows Command Prompt as Administrator
  • The original version of Excel used to create the VBA project (to match registered DLLs)

Step-by-Step

  1. Close all instances of Excel and any other Office applications. Open Task Manager (Ctrl+Shift+Esc), go to the Details tab, and end any remaining EXCEL.EXE or VBE7.DLL processes if they are still running.
  2. Press Windows+R to open the Run dialog. Type cmd and press Ctrl+Shift+Enter to open Command Prompt as Administrator. Confirm any User Account Control prompt.
  3. In the Command Prompt, navigate to the correct Office installation folder. For 64-bit Windows with 64-bit Office, type: cd "C:\Program Files\Microsoft Office\root\Office16". For 32-bit Office on 64-bit Windows, use: cd "C:\Program Files (x86)\Microsoft Office\root\Office16". For Office 2013, replace "Office16" with "Office15". For Office 2010, use "Office14".
  4. Register the Microsoft Excel type library by typing: regsvr32 excel.exe and press Enter. You should see a confirmation dialog saying "DllRegisterServer in excel.exe succeeded". If it fails, proceed to the next step.
  5. Register the VBA runtime library by typing: regsvr32 vbe7.dll and press Enter. Again, wait for the success message. If vbe7.dll is not found, locate it manually in the same folder or use Windows Search to find the file and copy its full path.
  6. If your VBA code references third-party controls (e.g., Microsoft Forms 2.0, Microsoft Windows Common Controls), register those too. For Forms 2.0, use: regsvr32 "C:\Windows\SysWOW64\fm20.dll" (for 32-bit Office on 64-bit Windows) or regsvr32 "C:\Windows\System32\fm20.dll" (for 64-bit Office).
  7. Restart your computer. After reboot, open Excel and press Alt+F11 to open the VBA Editor. Go to Tools > References and check for any missing or broken references marked as "MISSING". Uncheck them, then re-enable the correct versions if available.
  8. Reopen your workbook and run the macro again. If the error persists, proceed to the Troubleshooting section.

Common Mistakes

  • Running Command Prompt without administrative rights—this prevents registration from succeeding.
  • Using the wrong Office folder path (e.g., using Office16 when you have Office2019 installed as Office15).
  • Registering DLLs from a different system or Office version than the one currently installed—this causes version mismatches.
  • Skipping the computer restart, which is required for Windows to fully reload registered COM objects.
  • Trying to register .ocx or .dll files from the System32 folder without confirming they belong to the correct Office version—some files are shared with other apps and may be outdated.

Tips

  • Always back up your workbook before making registry changes, even though this fix doesn’t alter your files directly.
  • If you frequently use VBA with external libraries, create a batch file with the regsvr32 commands and run it as Administrator after major Windows updates.
  • Use the Windows Registry Editor (regedit) cautiously. Never delete keys unless you’re certain they’re orphaned—backup the registry first (File > Export).
  • For enterprise environments, consider deploying a script via Group Policy to auto-register common VBA components across multiple machines.
  • If you’re using Access or Outlook VBA alongside Excel, register their respective .dll files too, as they may share underlying COM objects.
  • Use the program "Dependency Walker" (if available) to check which COM classes are failing to load—this helps pinpoint the exact missing class.

Troubleshooting

If the error still appears after following all steps:

  1. Check the Office installation integrity. Open Control Panel > Programs > Programs and Features, select Microsoft Office, click Change, then choose Quick Repair. If that fails, run Online Repair.
  2. Verify the VBA project references. In the VBA Editor, go to Tools > References. If any are marked as "MISSING", note the name. Search online for the exact DLL name and its correct location for your Office version.
  3. Temporarily disable third-party add-ins. Go to File > Options > Add-Ins, select COM Add-ins from the Manage dropdown, click Go, and uncheck all. Restart Excel and test the macro again.
  4. Reinstall Microsoft Office completely. Uninstall via Control Panel, then download the latest installer from office.com using your Microsoft account. Install fresh and re-register the DLLs again.
  5. If you're on a corporate network, contact your IT department. Group Policy or security software may be blocking COM registration.
  6. As a last resort, create a new Windows user profile and test Excel there. If it works, your original profile’s registry hive may be corrupted.

Frequently Asked Questions

Why does this error happen after a Windows update?

Windows updates sometimes replace or overwrite system DLLs that Excel relies on. If the updated DLLs are incompatible or unregistered, VBA can't access the required classes.

Can I fix this without admin rights?

No. Registering COM components requires administrative privileges. Ask your system administrator to run the regsvr32 commands for you.

Is this error only in Excel?

No. It can occur in any Office application using VBA (Word, Access, Outlook) if they reference the same COM objects. The fix steps are identical across Office apps.

Will reinstalling Excel delete my macros?

No. Your workbooks and VBA code are stored separately from the Office installation. However, always backup your files before any reinstall.

Do I need to register every .dll file in Office?

No. Only register the ones referenced in your VBA code. Common ones are excel.exe, vbe7.dll, and fm20.dll. Registering others may cause conflicts.

Why does it work on my laptop but not my desktop?

Different Office versions (32-bit vs. 64-bit), different Windows builds, or missing third-party components on the desktop can cause this. Match the architecture and installed libraries on both machines.