Sounds like a clue, but where does this "Gallery1.TemplateFill" formula reside?
I have looked, in vain, at a dozen possible locations.
Please bear in mind, I'm transitioning from 20+ years of writing event-driven VBA code. In that scenario, I respond to the event.
In this scenario, the formula is lurking somewhere and takes effect, almost like magic, but only if you know the trick.