The EventMode property specifies whether VBA window events occur for the original or modified version of the window.
window.EventMode [= mode]
• window – A window object.
• mode – A constant specifying when events occur:
Constant |
Description |
---|---|
Window events occur only for the original version of the window. |
|
Window events occur only for the modified version of the window. |
|
Window events don’t occur for the window. |
If you modify a window using the Modifier, VBA window events will occur for the modified window only if you set the EventMode property to emModified. To change the EventMode property for the window object, use the Visual Basic Properties window.
If you modify a window containing a grid (such as a lookup window), you must change the EventMode property to emModifiedOnly for both the window and grid objects. Window and grid events can then occur for both objects.
Windows modified using the Modifier include a period (.) at the beginning of the window’s caption. Windows that invoke VBA events include a period at the end of the window’s caption.