Main Content

Excel Target Requirements and Limitations for MATLAB Compiler

Compiler Prerequisites

To generate Microsoft® Excel® add-ins using MATLAB®, you must have the following installed on a Windows® system:

For instructions on deploying Microsoft Excel add-ins, see Distribute Add-Ins and Integrate into Microsoft Excel.

Macro Execution Security Levels in Microsoft Excel

To generate add-ins and create macros with MATLAB Compiler, you must adjust the security settings accordingly in Microsoft Excel. Failure to do so may result in VBA code not being generated or warning messages sent to MATLAB Compiler.

  • For Microsoft Excel 2010 or newer:

    1. Click File > Options > Trust Center > Trust Center Settings > Macro Settings.

    2. In Developer Macro Settings, select Trust access to the VBA project object model.

MATLAB Compiler Excel Add-In Limitations

MATLAB Compiler supports the following function outputs for Excel add-ins:

  • No outputs

  • Figure (graphical) output

  • Scalar output

  • Multidimensional matrix output

  • Structure array output

It does not support MATLAB objects as inputs or outputs for compiled or deployed functions with Excel add-ins.

Dependencies on MATLAB objects or functions that are not compatible with MATLAB Compiler can prevent your code from compiling. For a list of functions that cannot be compiled, see Functions Not Supported for Compilation by MATLAB Compiler and MATLAB Compiler SDK. For detailed information about how MATLAB Compiler evaluates MATLAB code dependencies during compilation, see Dependency Analysis Using MATLAB Compiler. For information on ensuring your code is deployable, see Write Deployable MATLAB Code.

Work with Struct Arrays

To deploy a MATLAB function with structure arrays as input or output arguments, build Microsoft Excel macros and pass them (with the Excel add-in) to the end users. For more details on using struct array arguments in the Function Wizard, see Define Input Arguments.

If you do not create a macro, let your end users know:

  • Which arguments are structure arrays

  • Field names of the structure arrays

Deployment Target Architectures and Compatibility

Applications developed on one architecture must be compatible with the architecture on the system where they are deployed. For example, if you have a 64-bit system, you usually install a 64-bit version of MATLAB (and most other applications) by default.

Add-ins created with MATLAB Compiler are compatible with both 32–bit and 64–bit versions of Microsoft Excel. MATLAB Compiler itself is in 64–bit only.

Related Topics