VBA & Macro Problems

How to Fix Excel VBA Class Not Registered Error 80040154

Steve KSteve K Nov 3, 2026 868 views

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.

How to Fix Excel VBA Class Not Registered Error 80040154 When Opening 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'.
Before you start

Ensure you have administrative privileges on your computer, as fixing COM component registration and system files requires elevated permissions.

Solution 1Recommended

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.

1
Open Programs and Features

Open the Windows Control Panel, set the view to Category, and click on 'Uninstall a program' under Programs.

2
Locate Microsoft Office

Scroll through the list of installed applications to find your version of Microsoft Office.

3
Run Online Repair

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.

Perform an Online Repair of Microsoft Office
Verify Outlook Installation: Make sure the full desktop version of Microsoft Outlook is installed and activated. Excel VBA cannot interact with the web version of Outlook.
Free Microsoft Office alternative

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.

Fully compatible with Microsoft Excel (.xlsx) and macro-enabled (.xlsm) formats.Advanced spreadsheet capabilities without the heavy system requirements and registry bloat of MS Office.Free, all-in-one office suite for Windows, Mac, Linux, iOS, and Android.Familiar tabbed user interface ensuring a seamless migration and zero learning curve.
microsoft office alternative - wps office

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.