Why do I receive the error "ActiveX Component Can't Create Object" when referencing my COM component in my Visual Basic program?
2 views (last 30 days)
Show older comments
I have built a COM object using the MATLAB COM Builder Toolbox for MATLAB 6.5 (R13) successfully. However, when I go to add this COM object to my Visual Basic program I get an error.
These are the steps I performed to reference my COM object in my Visual Basic application:
1. Go to Menu -> Project -> References...
2. Click the Browse... button
3. Navigate to your COM object (e.g. mycom_1_0.dll)
4. Finally click OK
After click OK, I receive the following error:
ActiveX Component Can't Create Object
Accepted Answer
MathWorks Support Team
on 27 Jun 2009
The $MATLAB\bin\win32 directory (where $MATLAB = MATLABs root directory on your machine)
has to be on the system path before your COM component can be used. This directory ($MATLAB\bin\win32) must also occur on the path before any other $MATLAB\bin\win32 directories from previous installs of MATLAB. If you are seeing this error, it is most likely due to this setting.
First verify that the above directory is on your system path. If it is not, add it to your system path and make it the first item on your path. If it does exist on your path, move the directory path so that it is the first item on your system path, preceding any other MATLAB path directories from previous installations.
For more information on setting your system path, see the Related Solution.
0 Comments
More Answers (0)
Categories
Find more on Use COM Objects in MATLAB in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!