Main Content

ExcelAdd-Ins

CreateMicrosoft®Excel®add-ins from MATLAB®功能

MATLAB Compiler™lets you deploy MATLAB code toMicrosoft Exceland large-scale enterprise financial applications written inMicrosoft Visual Basic®. These add-ins can take the form of custom functions or can be integrated with Excel macros using Visual Basic for Applications (VBA).

Functions

compiler.build.excelAddIn CreateMicrosoftExceladd-in
compiler.build.ExcelAddInOptions Options for buildingExceladd-ins
compiler.package.installer Create an installer for files generated byMATLABCompiler
compiler.package.InstallerOptions Options for creatingMATLABCompilerpackage installers

Topics

Create and Integrate Add-Ins

Create Excel Add-In from MATLAB

Create an add-in containing a custom function for use within Excel and test it in an Excel workbook.

Distribute Add-Ins and Integrate Into Microsoft Excel

To integrate add-ins with Excel, register the DLL, install the add-in, and call methods from a spreadsheet.

Create Add-Ins Using Custom Functions

Create Macros from MATLAB Functions with Multiple Arguments

Create an Excel add-in using MATLAB functions with variable-length inputs and outputs.

Assign Multiple MATLAB Functions to Excel Class

Create an Excel add-in containing multiple functions and implement it in Excel.

集成ExcelAdd-Ins Using VBA

Build and Integrate Spectral Analysis Functions

This example illustrates the creation of a comprehensive Excel add-in to perform spectral analysis.

集成Components Using Visual Basic Application

See programming techniques for integrating your deployable Excel component into aMicrosoft Visual Basicapplication.

Function Wizard

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

The option to build and package MATLAB code from within the Function Wizard for Excel add-ins will be removed in a future release.

Execute Add-In and Graphical Function

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

Choose Function Deployment Workflow

General information about the two major workflows for creatingMicrosoft Exceladd-ins.

Manage Data Exchange

Reference Utility Classes

Referencing the classes in your programming environment.

Data Conversion Rules

Describes the process of converting data between MATLAB and Microsoft COM variants.

Array Formatting Flags

Describes the flags that control the formatting of data.

Data Conversion Flags

Describes the flags that control the conversion of data.

Troubleshooting

Errors and Solutions

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