Main Content

Build Excel Add-In and Deployable Archive

Note

Excel® add-in can be packaged using 64 bit Windows® and can be deployed on either 32 or 64 bit Excel.

To create an Excel add-In that integrates with MATLAB® Production Server™:

  1. Ensure that the setting Trust access to the VBA project object model is selected in the Excel Trust Center.

  2. Open the Production Server Compiler app.

    1. On the toolstrip, select the Apps tab.

    2. Click the arrow at the far right of the tab to open the apps gallery.

    3. Click Production Server Compiler to open the project window.

      Production Server Compiler with Deployable Archive with Excel Integration type selected and addmatrix.m in the exported functions section

  3. In the Application Type section of the toolstrip, select Deployable Archive with Excel Integration from the list.

  4. Specify the MATLAB functions you want to deploy.

    1. In the Exported Functions section of the toolstrip, click the plus button.

    2. In the file explorer that opens, locate and select the desired files.

    3. Click Open to select the files and close the file explorer.

      The selected files are added to the list of files and a minus button appears under the plus button.

      Note

      Functions that return a variable number of outputs are not supported by add-ins that use code running on a MATLAB Production Server instance.

  5. Inspect the Archive Information section of the app.

    The first text field is the name of the archive. The name of the archive determines the names of the generated artifacts and the URL used to connect to the server.

  6. Inspect the class mapping table to ensure that all desired functions are being compiled.

  7. If you need to change the marshaling rules for a function, select Data Conversion Properties from the function name’s context menu.

    For more information, see Data Marshaling Rules.

  8. Optionally configure the default server configuration packaged with the installer.

    The server configuration defines the connection to the MATLAB Production Server instance running the MATLAB code.

    1. Search the Default Server Configuration table for the URL to package with the installer.

    2. If it is in the table, select it.

    3. If not, click Add to add it to the table.

  9. Inspect the Files required for your archive to run and Files installed with your archive sections of the app.

    These sections of the app list all of the files that are packaged with the compiled code.

    Files required for your archive to run lists the files on which your function is dependent. They are packaged into the deployable archive and are only for the server. See Manage Required Files in Compiler Project (MATLAB Production Server).

    Files installed with your archive includes sections for both the client and the server. The files listed are generated by the compiler and should be delivered to the person installing the application.

  10. Click Package to generate the add-in and the deployable archive.

    Package window that says Creating Binaries. The option labeled Open output folder when process completes is checked.

  11. Select the Open output folder when process completes check box to display the generated output.

    When the deployment process is complete, a file explorer opens and displays the generated output.

  12. Click Close on the Package window.

  13. Verify the contents of the generated output:

    • for_redistribution — A client folder containing the generated installer and a server folder containing a .zip file

    • for_testing — A client folder containing the raw files generated for the add-in and a server folder containing the raw files generated for the deployable archive

    • for_redistribution_files_only — A client folder containing only the files needed to redistribute the add-in and a server folder containing only the files needed to redistribute the deployable archive

    • PackagingLog.txt — A log file generated by the compiler