- Many users have reported encountering the Class not registered VBA error when running a macro in Excel.
- This could be due to missing DLL files, corrupt system files, or issues with Microsoft Office itself.
- To solve the error, repair Microsoft Office, run the DISM and SFC scan, or try the two other fixes here.
Though the Microsoft Office suite is one of the best products in the category, users often come across errors in it. One such is the Class not registered VBA error in Microsoft Excel.
The error is usually encountered when trying to run a macro in Excel, though that’s not always the case. When this happens, you are unable to perform the desired function.
However, the Class not registered VBA error is not as intricate as it appears, and we have listed the best fixes for it in the following section.
How do I fix the Class not registered VBA error?
1. Repair Microsoft Office
- Press Windows + R to launch the Run command, type appwiz.cpl in the text field, and either click on OK or hit Enter to launch the Programs and Features window.
- Locate the Microsoft Office entry, select it, and then click on Change.
- Click Yes in the UAC (User Account Control) prompt that pops up.
- Now, select the Online Repair option, and click on the Repair button to start the process.
The repair process is found to eliminate a lot of issues with Microsoft Office including the Class not registered VBA error. If this method doesn’t work, head to the next one.
2. Register critical DLL file
- Press Windows + S to launch the Search menu, enter Windows Terminal in the text field at the top, right-click on the relevant search result, and select Run as administrator from the context menu.
- Click Yes in the UAC prompt that appears.
- Now, click on the downward-facing arrow, and select Command Prompt from the list of options. Alternatively, you can hit Ctrl + Shift + 2 to launch Command Prompt.
- Type/paste the following command and hit Enter:
- Now, execute the following command to register the required DLL file:
Another quick way to register missing DLL files or replace the corrupt ones is to use Fortect, a reliable third-party tool.
Apart from that, it will also look for corrupted files and repair the damage caused. Besides, the tool will also help optimize the Registry.
3. Run DISM and SFC scan
- Press Windows + R to launch the Run command, enter wt in the text field, press and hold the Ctrl + Shift key, and then click on OK or hit Enter to launch an elevated Windows Terminal.
- Click Yes in the UAC prompt.
- Click on the arrow at the top, and select Command Prompt from the dropdown menu.
- Now, paste the following three commands one at a time, and hit Enter after each to run the DISM tool:
DISM.exe /Online /Cleanup-image /Scanhealth
DISM.exe /Online /Cleanup-image /Restorehealth
DISM.exe /online /cleanup-image /startcomponentcleanup
- Now, execute the following command to perform the SFC scan:
The SFC (System File Checker) scan and DISM (Deployment Image Servicing and Management) tool are two effective methods to fix a bunch of issues having to do with corrupt system files or problems with the Windows image.
4. Update Microsoft Office
- Launch any Microsoft Office app, and open a new blank document.
- Now, click on the File menu near the top-left corner.
- Select Account from the list of options on the left.
- Next, click on the Update Options button under Product Information.
- Finally, select Update Now from the options in the flyout menu.
- Wait for the update to install, if there’s one available.
If it’s a problem with the current version, try installing the latest version of Microsoft Office.
These are all the ways you can fix the Class not registered VBA error when trying to run macro in Excel. In case none of the methods here help, upgrade to the latest iteration of MS Office available.
Also, find out how to fix the VBA runtime error 1004.
If you have any other queries or know a method that’s not listed here, please drop a comment in the section below.