Import Macros into Visual Basic Projects
- Updated2025-09-30
- 1 minute(s) read
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:
- Open the template in Word or Excel.
-
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.
- In the project window of the Visual Basic editor, right-click the template and select Import File from the shortcut menu.
- 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.