Visio Guy

Visio Discussions => ShapeSheet & Smart Shapes => Topic started by: BRCDbreams on January 24, 2013, 11:11:05 PM

Title: Problem Using DEPENDSON() with the Container Shape Sheet Relationship Cell
Post by: BRCDbreams on January 24, 2013, 11:11:05 PM
I want to trigger a procedure written in VBA when a shape is added or removed from a container.

I see that the Relationship cell in the Shape Layout section of the container shape sheet changes anytime a shape is added or removed to/from the container.  So, I created a User cell as below.

User.ShapeAddRemove    =DEPENDSON(Relationships)+CALLTHIS("TotalPortsInStack","ICXSwitchStacks")

When I add the first shape to the container, the VBA procedure "TotalPortsInStack" in the stencil "ICXSwitchStack" is called and runs.  But after that, this procedure never runs again for that container when I add or remove shapes in the container.

I thought the DEPENDSON() function would cause the CALLTHIS() to execute anytime a shape is added or removed in the container since the Relationship cell gets updated anytime a shape is added or removed from the container. But, that's not what happens.

What am I missing?
Title: Re: Problem Using DEPENDSON() with the Container Shape Sheet Relationship Cell
Post by: JuneTheSecond on January 26, 2013, 12:40:13 PM
I have no solution.
The behavior of this Relationship cell is mysterious.
I had thought Dependson function trigers events only when the value of the cell that Dependson function specifies changed.
But now I met the fact that it is not true. Because the value of Relationship cell is always False, it never changes.
Nevertheless, DEPENDSON(Relationships) react only at the first time when a shape is added to the Container.
It acts really only once while the values of the cell never changes.
Title: Re: Problem Using DEPENDSON() with the Container Shape Sheet Relationship Cell
Post by: Yacine on July 13, 2017, 04:54:03 PM
http://visguy.com/vgforum/index.php?action=post;msg=34249;topic=7960.0