Fix Excel VBA Class Not Registered Error After Office 365 Update
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.

- 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.
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.
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.
Open the Windows Control Panel, navigate to Programs and Features, select Microsoft 365 from the list, and click Uninstall.
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.
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.

Install or Repair the Microsoft Access Database Engine
Installing the correct Microsoft Access Database Engine redistributable ensures that the required ODBC database drivers are properly registered in the Windows registry.
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. Download the installer: Visit the official WPS Office website and click the free download button to get the latest lightweight installer.
- 2. Install the software: Run the downloaded setup file and follow the brief on-screen instructions to complete the setup process in minutes.
- 3. Open your spreadsheets: Launch WPS Spreadsheet and instantly open your existing Excel workbooks with all your formatting intact.

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.




