
Odd recalc behavior with shapeobj.duplicate
I am duplicating a shape under
VBA inside a group and then re-setting the
new shape's user.index field to a different numeric value. Changing the
user.index typically resets the shapes position in the group based on the
GUARDED formulas in the size and postition fields which all rely on this
field. But instead the duplicated shapes are all piling up on one another.
The duplication process works, the re-setting of the usersection index field
works, and the size and position fields are all intact but they act "frozen"
as if to avoid a recalc. If I go into the duplicated shape's shapesheet
and manually hit the enter key over each field (not changing the formulas),
they recalc one at a time and the duplicated shape takes it proper indexed
position in the group. The only programatic work-a-around I've come up with
is to use brute force and manually reset all of the duplicated shape's
formulas in VBA. But where is the value of the "duplicate" method if
these cells must all be re-established?
I'd appreciate any ideas.
Gary Fisk.
----------------------------------------------------------------------------
--
Public Sub Extend_Grid(gridshape As shape, nrows As Integer)
Dim prop_cnt, lastrow As Integer
Dim new_sblock, sblockobj As Visio.shape
Dim celobj As Object
...
Set sblockobj = gridshape.Shapes.Item(x) ' x = searches for several shapes
Set new_sblock = sblockobj.Duplicate
'lack of life from the resulting shape seems to require the following
business....
new_sblock.Cells("PinY").FormulaForce = sblockobj.Cells("PinY").Formula
new_sblock.Cells("PinX").FormulaForce = sblockobj.Cells("PinX").Formula
new_sblock.Cells("Width").FormulaForce = sblockobj.Cells("Width").Formula
new_sblock.Cells("Height").FormulaForce = sblockobj.Cells("Height").Formula
locpinx, etc.
...