Create Excel Add-Ins

Create Microsoft® Excel® add-ins and macros

Write the MATLAB® code for the add-in, create the function using the Library Compiler app, and package it into an installer for distribution. You can import the executable in Excel as an add-in. The Function Wizard enables you to iteratively test, develop, and debug your MATLAB function.

Apps

Library CompilerPackage MATLAB programs for deployment as shared libraries and components

Functions

libraryCompilerBuild and package functions for use in external applications
componentinfoQuery system registry about component created with MATLAB Compiler
mccCompile MATLAB functions for deployment
deploytoolCompile and package functions for external deployment

Examples and How To

Use MATLAB

Package Excel Add-In with Library Compiler App

This example shows how to create a Microsoft Excel add-in that computes a magic square using the Library Compiler app.

Create Macros from MATLAB Functions

Creating Excel add-ins from your MATLAB code

Use Function Wizard in Excel

Execute Functions and Create Macros

Workflow to incorporate your COM component into Microsoft Excel using the Function Wizard.

End-to-End Deployment of MATLAB Function

If you are still in the process of developing a MATLAB function that is not yet ready to be deployed, you may find this example to be an appropriate introduction to using MATLAB Compiler™ for Excel add-ins.

Execute Add-In and Graphical Function

Execute and test your functions, create macros, and more with the Function Wizard

Concepts

How Does MATLAB Deploy Functions?

To deploy MATLAB functions, the compiler performs these tasks:

MATLAB Data Files in Compiled Applications

Using MATLAB data files in compiled applications

Calling Shared Libraries in Deployed Applications

The loadlibrary function in MATLAB allows you to load shared library into MATLAB.

Supported Compilation Targets

Things to consider when creating an Excel Add-in with MATLAB Compiler

MATLAB Functions That Cannot Be Compiled

Functions not able to be compiled with MATLAB Compiler or MATLAB Compiler SDK™

Dependency Analysis

Basics about the dependency analysis function

MEX-Files, DLLs, or Shared Libraries

How the dependency function handles MEX-files, DLLs, and shared libraries

Write Deployable MATLAB Code

Writing MATLAB code that is sure to compile

Standalone Applications and Arguments

How to pass arguments to standalone applications and run applications that use arguments

Troubleshooting

Errors and Solutions

This appendix provides a table showing errors you may encounter using MATLAB Compiler, probable causes for these errors, and suggested solutions.

Was this topic helpful?