How do I resolve the automation error in VBA project, "ClassFactory cannot supply requested class" when using MATLAB Compiler SDK R2025b generated Excel add-ins?
Show older comments
I updated a MATLAB Compiler SDK application from MATLAB Runtime R2022a to MATLAB Runtime R2025b. The generated COM component is registered successfully, and I can create the COM objects from PowerShell using
New-Object -ComObject
However, when I attempt to initialize the MATLAB Runtime R2025b from Excel VBA using code similar to the following:
Set MCLUtil = CreateObject("MWComUtil.MWUtil")
Call MCLUtil.MWInitApplication(Application)
Excel reports the following error:
Runtime initialization failed.
Error number: -2147221231
Description: Automation error
ClassFactory cannot supply requested class
Source: VBAProject
The issue occurs even when using a version-specific ProgID, such as:
Set MCLUtil = CreateObject("MWComUtil.MWUtil25.2")
The COM component and MATLAB Runtime appear to be installed and registered correctly, and the same workflow works when using MATLAB Runtime R2022a.
How can I resolve this error?
Accepted Answer
More Answers (0)
Categories
Find more on COM Component Integration in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!