Author Topic: NoEventsPending and CellChange events  (Read 535 times)

0 Members and 1 Guest are viewing this topic.

perry59

  • Sr. Member
  • ****
  • Posts: 279
NoEventsPending and CellChange events
« on: June 09, 2022, 02:55:07 PM »
I have a function which changes several bits of data on a shape. Naturally this fires the CellChange event which I listen for but in this case I want to ignore. In other similar cases I just set a global variable called "IgnoreCellChange" which I watch for in my CellChange handler and if set I exit the sub.
In this particular case though, the data I am changing is taking place within my NoEventsPending handler. It seems that the CellChanged events do NOT fire when the NoPendingEvents handler is active, they fire AFTER the NoPendingEvents handler has completed so setting my ignore flag is useless. That means I am doing extra processing which is not needed.
So, the gist of the question is, is this typical behavior, the cell change events do NOT fire from within a NoPendingEvents handler but are delayed until after?
Thanks

Paul Herber

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3279
    • Paul Herber's website
Re: NoEventsPending and CellChange events
« Reply #1 on: June 11, 2022, 05:24:49 AM »
I suspect that events do not fire within an event handler. That could cause very deep or even infinite recursion into the event handlers.
Electronic and Electrical engineering, business and software stencils and applications for Visio -

https://www.paulherber.co.uk/

perry59

  • Sr. Member
  • ****
  • Posts: 279
Re: NoEventsPending and CellChange events
« Reply #2 on: June 14, 2022, 10:36:14 AM »
I suspect that events do not fire within an event handler. That could cause very deep or even infinite recursion into the event handlers.
Agreed, there is potential for disaster there. Still trying to find a work around though.
Thought about just setting a timer and doing my shape changes a couple seconds after the previous events conclude, but for some reason when I create a timer object my addin will not load.
Perry
« Last Edit: June 14, 2022, 11:07:39 AM by Paul Herber »