O'Reilly logo

VB & VBA in a Nutshell: The Language by Paul Lomax

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Property Get Statement

Named Arguments

No

Syntax

[Public | Private | Friend] [Static] Property Get name _
						
						 [(arglist)] [As type[()]]
    [statements]
    [name = expression]
    [Exit Property] 
    [statements]
    [name = expression]
End Property

Public

Use: Optional

Type: Keyword

Gives the property scope through all procedures in all modules in the project. If used within a createable class module, the property is also accessible from outside the project. Public, Private, and Friend are mutually exclusive.

Private

Use: Optional

Type: Keyword

Restricts the scope of the property to those procedures within the same module. Public, Private, and Friend are mutually exclusive.

Friend

Use: Optional

Type: Keyword

Only valid in a class module, it gives the property scope to all modules within a project, but not to modules outside the project. Public, Private, and Friend are mutually exclusive.

Static

Use: Optional

Type: Keyword

Preserves the value of variables declared inside the property between calls to the property.

name

Use: Required

The name of the property.

arglist

Use: Optional

Data Type: Any

A comma-delimited list of variables to be passed to the property as arguments from the calling procedure.

type

Use: Optional

The return data type of the property.

()

Use: Optional

Indicates that the property returns an array. As of VB6, Property Get procedures can return arrays.

statements

Optional

Program code to be executed within the property.

expression

Optional

Data Type: Any

The value to return from the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required