InvisibleApp.EventsEnabled property (Visio)

Determines whether a Microsoft Visio instance fires events. Read/write.

Syntax

expression.EventsEnabled

expression A variable that represents an InvisibleApp object.

Return value

Integer

Remarks

If the EventsEnabled property is False, Visio does not fire events, run add-ons, or execute strings that contain arbitrary Visual Basic for Applications (VBA) code when evaluating RUNADDON operands in cell formulas.

By default, the EventsEnabled property is True when an instance of Visio starts.

You may want to disable event firing if you have written code to handle events such as DocumentOpened or DocumentCreated that does not work properly, or to prevent the incorporation of a virus into a document. Events will not fire until the EventsEnabled property is set to True.

Example

These VBA macros show how to use the EventsEnabled property to suspend and resume event processing.

 
Public Sub SuspendEventProcessing_Example() 
 
 'Suspend event processing. 
 Application.EventsEnabled = False 
 End Sub 
 
Public Sub EventsEnabled_Example() 
 
 'Resume event processing. 
 Application.EventsEnabled = True 
 
End Sub

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.