User`s guide

4 Usage Examples
4-20
See Project Settings on page 2-6 for a description of new project settings.
3 Add the computefft.m and plotfft.m M-files to the project.
4 Save the project. Make note of the project directory because you will refer to
it later when you save your add-in.
5 Click Build to create the component.
Integrating the Component with Visual Basic for
Applications
Having built your component, you can implement the necessary VBA code to
integrate it into Excel. Follow these steps to open Excel and select the libraries
you need to develop the add-in.
1 Start Excel.
2 From the Excel main menu, select Tools->Macro->Visual Basic Editor.
3 When the Visual Basic Editor starts, select Tools->References to display
the
Project References Dialog. Check Fourier 1.0 Type Library and
MWComUtil 1.0 Type Library on the list.
Creating the Main VB Code Module For the Application
The add-in requires some initialization code and some global variables to hold
the applications state between function invocations. To achieve this,
implement a Visual Basic code module to manage these tasks, as follows:
1 Right-click on the VBAProject item in the project window and select
Insert->Module from the pop-up menu.
2 A new module appears under Modules in the VBA Project. In the modules
property page, set the
Name property to FourierMain. See the next figure.