How to Fix Excel VBA Class Not Registered Error 80040154
Question details
Users need to resolve a 'Class not registered' runtime error when using an Excel VBA macro to open or interact with Microsoft Outlook.

- Product
- Microsoft Excel and Outlook
- Device & OS
- Windows
- Scenario
- Running an Excel VBA script containing the command CreateObject("Outlook.Application") to automate email tasks.
- Observed behavior
- The macro execution halts and displays runtime error 2147721164 (80040154) stating 'Class not registered'.
Ensure you have administrative privileges on your computer, as fixing COM component registration and system files requires elevated permissions.
Perform an Online Repair of Microsoft Office
Use the built-in Windows repair tool to fix damaged Office installation files and re-register missing COM components.
This error is primarily caused by corrupted DLL files or damaged COM registrations within Microsoft Office. Running the Online Repair utility forces Windows to download and replace these corrupted components.
Open the Windows Control Panel, set the view to Category, and click on 'Uninstall a program' under Programs.
Scroll through the list of installed applications to find your version of Microsoft Office.
Right-click on Microsoft Office and select 'Change'. In the dialog that appears, select 'Online Repair' (or 'Repair' depending on your version) and follow the on-screen prompts.

Repair Windows System Files via Command Prompt
If repairing Office does not resolve the issue, use DISM and SFC commands to fix underlying Windows operating system corruption.
Experience a Seamless and Lightweight Alternative with WPS Office
Tired of dealing with complex Microsoft Office repairs, COM registration failures, and registry errors? WPS Office offers a free, highly compatible alternative with built-in tools for spreadsheets, documents, and presentations. Enjoy a lightweight installation that won't bog down your system.

Frequently Asked Questions
What does error 80040154 'Class not registered' mean in Excel VBA?
This error occurs when the VBA script tries to create an object (like Outlook.Application) using a COM interface, but the operating system cannot find the necessary registry keys or DLL files to launch the target application.
Can I use CreateObject('Outlook.Application') if I only use Outlook on the web?
No, the VBA CreateObject method requires the full desktop application of Microsoft Outlook to be locally installed and properly registered on your machine.
Will reinstalling Microsoft Office fix the 'Class not registered' error?
Yes, performing an Online Repair or doing a complete uninstall and reinstall of Microsoft Office usually rebuilds the corrupted registry entries and resolves the COM registration issue.




