Author Topic: MarkerEvent is firing when shape is dropped on page  (Read 584 times)

0 Members and 1 Guest are viewing this topic.

Visisthebest

  • Hero Member
  • *****
  • Posts: 637
MarkerEvent is firing when shape is dropped on page
« on: February 08, 2022, 02: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)
« Last Edit: February 08, 2022, 02:09:08 PM by Visisthebest »
Visio 2021 Professional

Visisthebest

  • Hero Member
  • *****
  • Posts: 637
Re: MarkerEvent is firing when shape is dropped on page
« Reply #1 on: February 08, 2022, 02: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.
Visio 2021 Professional

wapperdude

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4373
  • Ideas Visio-lized into solutions
Re: MarkerEvent is firing when shape is dropped on page
« Reply #2 on: February 08, 2022, 02: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. 

Visio 2019 Pro

Visisthebest

  • Hero Member
  • *****
  • Posts: 637
Re: MarkerEvent is firing when shape is dropped on page
« Reply #3 on: February 08, 2022, 03: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.
Visio 2021 Professional