Table of contents
Collapse the table of content
Expand the table of content

Module.ProcCountLines Property (Access)

office 365 dev account|Last Updated: 6/12/2017
1 Contributor

The ProcCountLines property returns the number of lines in a specified procedure in a standard module or a class module. Read-only Long.


expression. ProcCountLines( ** ProcName, ** ProcKind )

expression A variable that represents a Module object.


NameRequired/OptionalData TypeDescription
ProcNameRequiredStringThe name of a procedure in the module.
ProcKindRequiredvbext_ProcKindThe type of procedure. See the Remarks section for the possible settings.


The ProcKind argument can be one of the following vbext_ProcKind constants:

vbext_pk_GetA Property Get procedure.
vbext_pk_LetA Property Let procedure.
vbext_pk_ProcA Sub or Function procedure.
vbext_pk_SetA Property Set procedure.

The procedure begins with any comments and compilation constants that immediately precede the procedure definition, denoted by one of the following:

  • A Sub statement.

  • A Function statement.

  • A Property Get statement.

  • A Property Let statement.

  • A Property Set statement.

The ProcCountLines property returns the number of lines in a procedure, beginning with the line returned by the ProcStartLine property and ending with the line that ends the procedure. The procedure may be ended with End Sub, End Function, or End Property.

Note The ProcCountLines property treats Sub and Function procedures similarly, but distinguishes between each type of Property procedure.


The following example displays a message indicating the number of lines in a given procedure.

Dim strForm As String 
Dim strProc As String 

strForm = "Products" 
strProc = "Form_Activate" 

MsgBox "There are " &; Forms(strForm).Module.ProcCountLines(strProc, vbext_pk_Proc) &; _ 
 " lines in the " &; strProc &; " procedure."

See also


Module Object

© 2018 Microsoft