Error in VBAProject: ActiveX component can't create object
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi,
I am currently trying to call a matlab function from excel using an excel addin made in matlab. However, i run into trouble at the moment where i call the function in excel and i get this error message "Error in VBAProject: ActiveX component can't create object"
I am trying first to run the example in the MATLAB documentation i.e making an excel addin for the mymagic function defined as below:
function y = mmmagic(x)
% MYMAGIC Magic square of size x.
% Y = MYMAGIC(X) returns a magic square of size x.
% This file is used as an example for the MATLAB Compiler product.
% Copyright 2001-2007 The MathWorks, Inc.
y = magic(x)
which i stored in a M-file: mymagic.m
now, i go to the MATLAB compiler and create a new project for an excel-addin and name it mymagic. i rename the class (class1) as mymagic and i add my M-file mymagic.m then i build my project. Then i go to my distrib directory to collect mymagic.xla which i slide into my excel spreadsheet. Now i add the dll into the registry by executing this line regsvr32 "C:\Users\Desktop\mmyagic\distrib\mymagic_1_0.dll" in the Run app
Finally, when i run mymagic function in excel i get the error message "Error in VBAProject: ActiveX component can't create object". Could someone help with this please? Many thanks
1 comentario
Othmane ELMOUATAMID
el 12 de Nov. de 2018
Hello Nour Tateb,
Is MCRinstaller/MATLAB already installed in the computer where you're trying to use your mymagic.xla ?
Also, did you add the path of your add-in to the list of "Trusted Locations" in MS-Excel ?
Respuestas (0)
Ver también
Categorías
Más información sobre Spreadsheets en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!