Hi,
So after my last topic I've worked on cleaning up some documents, and I've run into a problem. Where certain shapes won't let me replace them with a master, this is a shape that does not have a master. It's grouped in another shape with more shapes on the same group level. None of the shapes are protected in any way and none of them belong to a locked layer, but still I can't replace it. If I completely ungroup the shape it works normally. This shape is not different from all the other shapes in the document, so I might replace 20-30 shapes on a page but 2-5 will fail to replace.
I do a bunch of stuff to sort out the shapes but the main process is finding a shape with "Terminal" in it's name and replacing it with the "Terminal" master shape if it does not have a master.
To do this I use Shape.ReplaceShape(Master, Replace Flags) and this is the line that fails. For the flags I use "1" and I've tried with the other options but none have yielded better results, and I don't see why the flags would be a problem when it works on the majority of the shapes.
https://learn.microsoft.com/en-us/office/vba/api/visio.shape.replaceshapeThis issue persists when the shape is copied to a new document so I will attach a sample here. In this sample I am trying to replace "Terminal.4171" with a copy of the "Terminal" master shape.
Any idea of what is preventing this would be appreciated.