Import Macros into Visual Basic Projects

If you are using a Microsoft Word or Microsoft Excel template that contains a macro, you can manually import the module containing the macro into the Visual Basic for Applications (VBA) project associated with the template.

Complete the following steps to import the module manually:

  1. Open the template in Word or Excel.
  2. Select Tools»Macro»Visual Basic Editor.
    Note If using Microsoft Word or Excel 2007, access the Visual Basic Editor by opening the Developer tab, select Visual Basic.
  3. In the project window of the Visual Basic editor, right-click the template and select Import File from the shortcut menu.
  4. Select the file in which the macro is defined and click the Open button.

The Word Import Module VI and the Excel Import Module VI can import modules dynamically from a VBA function file (.bas) or from a LabVIEW string that contains the module source code.