User`s guide
4 Stand-Alone Applications
4-32
Building Excel Plug-Ins
Note To create Excel plug-ins from the MATLAB Compiler, you must have
the MATLAB Excel Builder installed on your system.
You can use
mbuild to create a COM object from MATLAB M-files that can be
used as an Excel plug-in. The collection of M-files is translated into a single
Excel plug-in. MATLAB Excel Builder supports one class per component.
The interface to the COM class is the same set of functions that are exported
from a C shared library, but the Compiler supports both C and C++ code
generation in producing COM objects.
mbuild automatically:
• Invokes the Microsoft Interface Definition Language (MIDL) compiler
• Invokes the resource compiler
• Specifies the
.DEF files
Using
mbuild options you can enable auto registration of the COM-compatible
DLL.
Note Creating Excel plug-ins from MATLAB M-files is available on Windows
only. The only compilers that support the building of Excel plug-ins with the
MATLAB Compiler are Borland C++Builder (versions 3.0, 4.0, and 5.0) and
Microsoft Visual C/C++ (versions 5.0, 6.0, and 7.0).
For example, to compile
plus1.m into an Excel plug-in, use
mcc -B 'cexcel:addin,addin,1.0' plus1.m
For more information, see the MATLAB Excel Builder documentation.