Handling events associated with ActiveX components is done with the WithEvents keyword.