Event on changes in the container

Previous chapterNext chapter Show allShow all    Hide allHide all

Activating the event:

Container . Define

This command line activates the monitoring of the variables in the container. After executing the command Define, the container is active.

Creating the event:

Private Sub Container _ VariableChange ( ByVal obVar As zenOn . IVariable )

...

End Sub

This event is automatically created, when the container is selected in the left combobox at the top of the VBA Editor. The procedure above then is added to the source code. With obVar the variable with the changed value is passed on.

When this event occurs, e.g. the current value of the variable (obVar.Value) can be read. Refer to the object hierarchy in the VBA documentation to see the properties and values of variables, which can be used.

Functionality of the event:

If the container is activated (Container.Define), all variables in the container are forced once, so that the current value of the variables are known. So the procedure Container_VariebleChange is executed for each variable in the container. As soon as all variables then have been initialized, this event always occurs, if one of the variables of the container changes its value.

So it is avoided, that a value is read, which is not the current value of the variable.