Visio Guy

Visio Discussions => ShapeSheet & Smart Shapes => Topic started by: Visisthebest on February 08, 2022, 07:02:32 PM

Title: MarkerEvent is firing when shape is dropped on page
Post by: Visisthebest on February 08, 2022, 07:02:32 PM
I have a group shape, where one of the subshapes has this formula to fire a MarkerEvent when shape data in the group (top) shape is changed:

=QUEUEMARKEREVENT("Fire my QME Event")+DEPENDSON(Sheet.1!Prop.MyData)

Unfortunately the event already is firing when the shape is dropped on the page (by the user). How can I prevent the MarkerEvent from firing in this case, it should only fire when the user changes the shape data.

(the particular shape data field is a dropdown)
Title: Re: MarkerEvent is firing when shape is dropped on page
Post by: Visisthebest on February 08, 2022, 07:30:54 PM
I think I found the issue, although I cannot fully explain why.

In my specific use case the formula is like this:

=QUEUEMARKEREVENT("Fire my QME Event,"&Sheet.1!ID())+DEPENDSON(Sheet.1!Prop.MyData)

it looks like even though the DEPENDSON points to a cell that doesn't change, because this formula contains the ID() function it fires anyway on the dependson.

Please note that many other places there is a:

=QUEUEMARKEREVENT("Fire my QME Event,"&Sheet.1!ID())

which never fire when ID() is added to the formula when the shape is added.
Title: Re: MarkerEvent is firing when shape is dropped on page
Post by: wapperdude on February 08, 2022, 07:54:12 PM
For a grouped shape, upon drop, I believe the shape references get triggered as Visio updates these references.  For example, a page may have 5 shapes before dragging/dropping.  The sheet.1! reference must update as the newly dropped group ID cannot be something that is already placed.  Thus, in a sense, the dependson fcn is being triggered. 

Title: Re: MarkerEvent is firing when shape is dropped on page
Post by: Visisthebest on February 08, 2022, 08:29:26 PM
Good to know wapperdude thank you!

I tried it in a nongrouped shape and in addition to what you indicate, also in a non-grouped shape I get a MarkerEvent fired if ID() (of the single non-grouped shape) is added to the formula. So it seems the trigger comes from the fact that the shape is grouped or just from ID() being added to the formula.