EventsEnabled property

Microsoft Visio Developer Reference

EventsEnabled property

       

Determines whether a Microsoft Visio instance fires events.

Version added

4.5

Syntax

intRet = object.EventsEnabled
object.EventsEnabled = intExpression

intRet

Integer. False (0) if event firing is disabled; True (-1) if event firing is enabled.

object

Required. An expression that returns an Application object.

intExpression

Required Integer. False (0) to disable event firing; True (non-zero) to enable event firing.

Remarks

If the EventsEnabled property is False, Visio does not fire events, run add-ons, or execute Microsoft Visual Basic for Applications 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 code behind 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.

To set the EventsEnabled property to False in another way:

  1. On the Tools menu, click Options.
  1. In the Options dialog box, click the Advanced tab.
  1. Clear the Enable Automation events check box.