Excel Add-Ins
MATLAB Compiler™ enables you to package MATLAB programs into add-ins for use with Microsoft Excel. Excel add-ins allow users to interact with spreadsheet data, display MATLAB figures, open dialog boxes, and more.
To deploy Excel add-ins, you install the add-in and MATLAB Runtime on the target machine. After installation, you can:
Invoke add-in functions directly in the form of Excel custom functions. For an example, see Assign Multiple MATLAB Functions to Excel Class.
Integrate add-in functions into Excel macros using the Function Wizard. Macros allow you to specify input and output cells, handle multiple outputs, and set additional run-time options. For an example on using the Function Wizard, see Create Macro Using Multiple MATLAB Functions.
Integrate add-in functions into Excel macros using custom Visual Basic® for Applications (VBA) code. For VBA programming techniques, see Integrate Components Using VBA.
Apps
Library Compiler | Package MATLAB programs for deployment as shared libraries and components |
Functions
compiler.build.excelAddIn | Create Microsoft Excel add-in (Since R2021a) |
compiler.build.ExcelAddInOptions | Options for building Excel add-ins (Since R2021a) |
compiler.package.installer | Create an installer for files generated by MATLAB Compiler (Since R2020a) |
compiler.package.InstallerOptions | Options for creating MATLAB Compiler package installers (Since R2020a) |
Topics
Requirements and Highlights
- Excel Target Requirements and Limitations for MATLAB Compiler
See tasks you must perform before creating Excel add-ins using MATLAB Compiler. - Distribute Add-Ins and Integrate into Microsoft Excel
To deploy add-ins, register the add-in and utility libraries, then install the add-in. - How Excel Add-In Compilation Works
Overview of how MATLAB Compiler works with Excel add-ins.
Create and Integrate Add-Ins
- Create Excel Add-In from MATLAB
Create an add-in containing a custom function and test it in an Excel workbook. - Create Microsoft Excel Add-in from MATLAB Function Using Library Compiler App
Try an example on creating an Excel Add-in using the Library Compiler app. - Distribute Add-Ins and Integrate into Microsoft Excel
To deploy add-ins, register the add-in and utility libraries, then install the add-in.
Use Custom Functions in Excel
- Assign Multiple MATLAB Functions to Excel Class
Create an Excel add-in with multiple functions and call your custom functions in Excel.
Create Macros Using Function Wizard
- Create Macro Using Multiple MATLAB Functions
Use the Function Wizard to create a macro using MATLAB functions with variable-length inputs and outputs. - Create Macros with Graphical Functions
Create macros that display graphical output and dialog boxes using the Function Wizard. - Install and Use Function Wizard
Install the Function Wizard add-in and create macros using compiled MATLAB functions.
Create Macros Using VBA
- Implement User Interface Using Visual Basic Form Controls
Use VBA form controls to create a spectral analysis application with a custom user interface. - Integrate Components Using VBA
Apply programming techniques for integrating your deployable Excel component into a Microsoft Visual Basic application.
Manage Data Exchange
- Reference Utility Classes
Reference the MWComUtil library in your VBA programming environment. - Data Conversion Rules
Learn the process of converting data between MATLAB and Microsoft COM variants. - Array Formatting Flags
Refer to the flags that control data formatting. - Data Conversion Flags
Refer to the flags that control data conversion.
Troubleshooting
- Errors and Solutions
View errors you may encounter using MATLAB Compiler, probable causes for these errors, and suggested solutions. - Deployment Product Terms
See descriptions for deployment product terms.