概述
Hello,
I'm having trouble in embedding matlab code into excel. The code receives input arguments from a vba function and return the output to the same vba function.
I can create the .xla file and the related files but it seems that this method is machine dependent.
For example, if I create a simple function like this:function q = somma(w,e)
q=w+e;
end
and then I try to create an Excel AddInn through the matlab compiler it fails at the end without creating any installer. But If I use the command:mcc -W 'excel:somma,Class1,1.0' -T link:lib -b -d D:AlMATLABsomma -v class{Class1:D:AlMATLABsomma.m}
it creates these files:Class1_com.cpp
Class1_com.hpp
dlldata.c
mccExcludedFiles.log
mwcomtypes.h
mwcomtypes_i.c
mwcomtypes_p.c
readme.txt
requiredMCRProducts.txt
somma.bas
somma.def
somma.rc
somma.xla
somma_1_0.dll
somma_1_0.exp
somma_1_0.lib
somma_dll.cpp
somma_idl.h
somma_idl.idl
somma_idl.tlb
somma_idl_i.c
somma_idl_p.c
If I open the .xla or import .bas into my worbook the function works but it's machine dependent. If I try to add the .dll as a COM object into my workbook Excel says that "it is not a valid Office AddInn".
If instead I use this command:mcc -W 'com:somma,Class1,1.0' -T link:lib -d D:AlMATLABsomma -v class{Class1:D:AlMATLABsomma.m}
I get more or less the same files (not the .xla and .bas) but I have the same problem with the .dll.
Is there any way to achieve what I want? Do I have to install the MATLAB runtime? but I would like that the people that will use my Excel file, just needed it and nothing more. Is it possible?
Many thanks
AL
最后
以上就是欣喜棒球为你收集整理的embed在matlab,Embed Matlab Code into excel的全部内容,希望文章能够帮你解决embed在matlab,Embed Matlab Code into excel所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复