VBA & Macro Problems

Fix Excel VBA Class Not Registered Error After Office 365 Update

Huma Ashraf ChHuma Ashraf Ch Oct 22, 2026 870 views

Question details

The user encounters a 'Class not registered' runtime error when executing the CreateWorkspace statement in Excel VBA using dbUseODBC after a recent Office 365 update.

How to Fix Excel VBA Class Not Registered Error After Office 365 Update
Product
Microsoft Excel (Office 365)
Device & OS
Windows
Scenario
Running an Excel VBA macro that relies on ODBC database drivers to create a workspace connection.
Observed behavior
VBA execution stops and displays runtime error -2147221164 (80040154), 'Class not registered', and standard online Office repairs do not resolve the issue.
Before you start

Verify whether your Windows operating system is 32-bit or 64-bit, and check your current Microsoft Office version bitness in the Account settings before making any installation changes.

Solution 1Recommended

Reinstall the 32-bit Edition of Office 365

Since many legacy ODBC database drivers are exclusively 32-bit, replacing a 64-bit Office installation with the 32-bit version often resolves the registry conflict, even on a 64-bit Windows system.

Office 365 updates can sometimes automatically migrate your installation to the 64-bit version. This breaks compatibility with existing 32-bit ODBC database drivers, causing VBA to fail at the CreateWorkspace execution because it cannot locate the correct 64-bit class in the registry.

1
Uninstall your current Office 365 installation

Open the Windows Control Panel, navigate to Programs and Features, select Microsoft 365 from the list, and click Uninstall.

2
Download the 32-bit installer

Log into your Microsoft account online, navigate to your Office installation options, select 'Other options', and explicitly choose the 32-bit version from the dropdown menu.

3
Install and verify your VBA script

Run the downloaded 32-bit setup file. Once the installation is fully complete, open your Excel VBA project and test the CreateWorkspace macro again to ensure the drivers connect properly.

Reinstall the 32-bit Edition of Office 365
Bitness matching: Ensuring that your Office installation bitness matches your available ODBC drivers is the most reliable way to prevent COM class registration errors in VBA.
Free Microsoft Office alternative

Experience Stable Spreadsheet Performance with WPS Office

If automatic Office 365 updates frequently disrupt your workflow by breaking macros or unregistering database drivers, consider switching to WPS Office. It provides robust spreadsheet functionalities, avoids bloated update issues, and remains highly compatible with standard file formats.

  1. 1. Download the installer: Visit the official WPS Office website and click the free download button to get the latest lightweight installer.
  2. 2. Install the software: Run the downloaded setup file and follow the brief on-screen instructions to complete the setup process in minutes.
  3. 3. Open your spreadsheets: Launch WPS Spreadsheet and instantly open your existing Excel workbooks with all your formatting intact.
Seamlessly compatible with Microsoft Excel (.xlsx, .xls) files and structures.Free, lightweight, and fast-loading alternative to bulky Office 365 installations.Stable performance without forced, disruptive background updates.Familiar tabbed user interface for quick navigation and multitasking.
microsoft office alternative - wps office

Frequently Asked Questions

What exactly causes runtime error 80040154 (Class not registered) in Excel VBA?

This runtime error is triggered when VBA attempts to call a COM component or ODBC database driver that is not properly registered in the Windows registry. This frequently happens after an Office update changes the software bitness from 32-bit to 64-bit, breaking the link to existing 32-bit drivers.

Why does the CreateWorkspace statement fail specifically when using dbUseODBC?

The CreateWorkspace method relies on specific ODBC drivers to establish database connections. If an Office update alters the application environment or unregisters these background drivers, VBA can no longer locate the necessary classes in the registry to execute the connection, resulting in an immediate failure.

Will running an online repair of Office 365 resolve the 'Class not registered' error?

An online repair often fails to resolve this specific issue because it simply repairs the existing installation. If the root cause is an underlying mismatch between a 64-bit Office installation and 32-bit database drivers, you must completely uninstall Office and manually reinstall the 32-bit edition instead.