Export Method

Applies To

VBComponent object.

Description

Saves a component as a separate file or files.

Syntax

object.Export(filename)

The Export syntax has these parts.

Part

Description

object

Required. An object expression that evaluates to an object in the Applies To list.

filename

Required. A String specifying the name of the file that you want to export the component to.


Remarks

When you use the Export method to save a component as a separate file or files, use a file name that doesn't already exist; otherwise, an error occurs.

See Also

Import method.

Example

The following example creates a file named test.bas and uses the Export method to copy the contents of the VBComponents(1) code module into the file.

Application.VBE.ActiveVBProject.VBComponents(1).Export("test.bas")