Odd recalc behavior with shapeobj.duplicate 
Author Message
 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.

...



Fri, 07 May 2004 09:38:25 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Odd behavior with Dates -A2K

2. Access 2.0 odd transaction behavior

3. Odd Behavior With CommitTrans

4. odd Add Note behavior

5. Externally adding tasks via SQL gives odd behavior

6. Odd behavior when inserting TextBox1 into header

7. Odd behavior by socket.select()

8. Very odd behavior with DataTable.Select

9. odd behavior in Qbasic

10. Help, VFP - List boxes on pageframes with odd behavior

11. Odd printing behavior on Win2000

12. Odd behavior with setfocus

 

 
Powered by phpBB® Forum Software