Hello,
I am new to Visio and I am facing an annoying issue.
I have the following code that changes the value of FillForegnd successfully (when viewed in the ShapeSheet).
The problem is that it does not change on the screen itself.
My project is an Org Chart, where I'd like to change certain shapes' color. So in fact the shape is a group.
My loop is going through all shapes (avoiding the lines by checking the Prop.Name presence).
For Each vsoshape In vsoPage.Shapes
If vsoshape.CellExists("Prop.Name", False) Then
Set cell = vsoshape.Cells("FillForegnd")
cell.FormulaU = "RGB(255, 0, 0)"
End If
Next
thank you and regards,
Syntax error, was:
Set cell = vsoshape.Cells("FillForegnd")
cell.FormulaU = "RGB(255, 0, 0)"
becomes:
vsoshape.Cells("FillForegnd").FormulaU = "RGB(255, 0, 0)"
Note, however, in this context, VBA sets the group color specifically, and the value does not pass down to the subshapes. You have to additional checking for subshapes, and then change their fill. See http://www.visguy.com/2008/05/17/detect-sub-selected-shapes-programmatically/ (http://www.visguy.com/2008/05/17/detect-sub-selected-shapes-programmatically/)