Programming with Reflection
ImportVBAProjectItem method
Syntax object.ImportVBAProjectItem Filename, [Options]
Imports a Visual Basic project item. You can import code modules, forms, or classes.
For example, the following statement imports a code module called NewMacros. If a module of the same name already exists, the imported module is automatically renamed NewMacros1, NewMacros2, and so on.
Session.ImportVBAProjectItem "C:\ProjectFiles\NewMacros.bas"
Filename Argument type: String
Required
Specifies the name of the project file (*.bas, *.frm or *.cls) to import. You can include complete path information.
Options Omit this argument; it is not currently used.