MATLAB COM Builder    

Adding The Spectral Analysis Menu Item to Excel

The last step in the integration process adds a menu item to Excel so that you can invoke the tool from Excel's Tools menu. To do this you add event handlers for the workbook's AddinInstall and AddinUninstall events that install and uninstall menu items. The menu item calls the LoadFourier function in the FourierMain module. Follow these steps to implement the menu item:

  1. Right-click on the ThisWorkbook item in the Visual Basic project window and select View Code from the pop-up menu. See the next figure.

Figure 4-8: Adding a Menu Item to Excel

  1. Place the code below into the ThisWorkbook object.

  Creating The Visual Basic Form Saving the Add-in