CodeModule Property

Applies To

CodePane object, VBComponent object.

Description

Returns an object representing the code behind the component. Read-only.

Remarks

The CodeModule property returns Nothing if the component doesn't have a code module associated with it.

Note   The CodePane object represents a visible code window. A given component can have several CodePane objects. The CodeModule object represents the code within a component. A component can only have one CodeModule object.

See Also

CodeModule object.

Example

The following example uses the CodeModule and CountOfLines properties to return the number of lines in a particular code module.

Debug.Print Application.VBE.ActiveVBProject.VBComponents(6).CodeModule. _
    CountOfLines