Events

Download vba eBook

Syntax

  • Source Module: [Public] Event [identifier]([argument_list])

  • Handler Module: Dim|Private|Public WithEvents [identifier] As [type]

Remarks

  • An event can only be Public. The modifier is optional because class module members (including events) are implicitly Public by default.

  • A WithEvents variable can be Private or Public, but not Friend. The modifier is mandatory because WithEvents isn't a keyword that declares a variable, but a modifier keyword part of the variable declaration syntax. Hence the Dim keyword must be used if an access modifier isn't present.

Related Examples

Stats

57 Contributors: 1
Monday, August 8, 2016
Licensed under: CC-BY-SA

Not affiliated with Stack Overflow
Rip Tutorial: info@zzzprojects.com

Download eBook