Protect custom stencil shapes from themes

Started by Blackhawk, July 05, 2019, 02:59:27 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Blackhawk

Thanks.   This I have done, but I also want to set the Theme Properties to 0 and was not able to find where in the object model this is located.

Do you know how to find this?

Croc

    For i = 0 To 7
        ActivePage.Shapes(1).CellsSRC(visSectionObject, visRowThemeProperties, i).FormulaU = "0"
    Next

Instead of ActivePage.Shapes (1) you need to substitute the desired shape

Blackhawk

Ah!  Thanks.

I didn't see CellsSRC in the object model when looking at the watch window.    I will try that.

Thanks

Surrogate

#33
Please looking for "Sections, Rows, Cells" at right side

PS You can't find these items in Watch Window

Blackhawk

Just want to say thanks to everyone for your assistance.   

I ended up having to abandon the effort once again.  No matter what I do I still keep running into issues where Visio tries to change things despite protection settings, shapesheet guard formulas, etc., and it is taking WAY WAY too much time to debug and write code to make it work properly.   Such a shame...

The solution at the moment is to disable themes in the document and then everything works.   That is too bad because I would like other shapes to be themed in the same document but just leaving my stencil shapes alone.   

Once again, thanks for helping.   I learned some interesting things about Visio (quite frankly, however,...shouldn't need to know for this type of problem) that perhaps I can apply at some point down the road for other things.

Keep up the great work with the forum!

vojo

one last suggestion:  Have tried guarding the theme cells themselves?

Blackhawk

To some extent yes, but the problem is, I have a lot of different types of shapes and it takes a bit of time to discern what is all required.

For example, some shapes are just simple lines.   So the only way to protect those, seemed to be protecting the Format option, but then that affects the ability to change the arrows when in the document (which I need that ability).

Other times, the shapes are composites which some shapes need protecting in one way, and other shapes need it differently.   It became quite a daunting task to test all the possibilities of what to protect and what not to.   It wasn't like I had hoped which was just loop through all the shapes and subshapes setting all the theme properties to 0.   Sometimes they had formulas in them. 

I have learned that Visio is pretty damned powerful, but also frickin complicated if it doesn't behave like you want it to.   It would be nice if the "Theme Protection" settings just worked, but there seems to be so many other factors that get in the way.

Maybe when I am bored and have nothing better to do with my life, I will go back in and figure this out.  Right now, I gotta get stuff done.   :o

vojo