Setting a shapesheet field to default

Started by phillip_141, November 19, 2015, 02:05:24 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

phillip_141

Is there a way to set a shapesheet cell to default en masse through vba?

The problem I am having it that I have created several master shapes that I work with. Whenever a new shape is created with the master shape all of the master's values become default values for the spawned shape. This is quite convenient because when I make updates to the master, I can just replace all the shapes with a macro and their default fields will update. The issue I'm currently facing however, it that sometimes a field will have a manual(Blue) entry in it somehow which prevents the default value update from taking effect. I can easily go to the cell in the shapesheet and just press "Delete" to clear  the contents, but I'm having a difficult time figuring out how I might do this from VBA. Any help would be greatly appreciated!!  ;D

Notes: Currently using Visio Pro 2013

Surrogate

Dim SH As Shape
Set SH = ActiveWindow.Selection(1)
SH.Cells("user.visversion").Formula = """"""

phillip_141

Set SH = ActiveWindow.Selection(1)
SH.Cells("user.visversion").Formula = """"""

This actually doesn't work. What it does is to set the value of the cell to "" rather than setting it to the default value.

Surrogate

i don't know it default value :)
Quote from: phillip_141 on November 19, 2015, 02:05:24 PM
I can easily go to the cell in the shapesheet and just press "Delete" to clear  the contents, but I'm having a difficult time figuring out how I might do this from VBA.

phillip_141

haha right. So doing what you are suggesting, basically just changing the cell value, will work but not as elegantly as I would like. If, for instance, I were to make edits to several of a master shape's values, I would need to run a  replace shape on all the shapes on the page and then edit  the macro which individually updates cells. I just want to be able to reset a cell's value to the default value from the master. i.e. if  the  master  has the  field  Prop.interfacetype "Water  Flow" and I spawn a shape from that master, that shape's  default value for Prop.interfacetype would  be  "Water  Flow" not  "".

Yacine

Yacine


phillip_141

Ah thank you both very  much! The "=" formula change sorted it out for me!