C# Interop Shape xlMoveAndSize property doesn't stick

  • Thread starter Thread starter BIG_j
  • Start date Start date
B

BIG_j

I create a shape and set the Placement as follows...

Excel.Shape myPicture = _ActiveSheet.Shapes.AddPicture(Location,
MsoTriState.msoFalse, MsoTriState.msoTrue, TargetLeft, TargetTop,
TargetWidth, TargetHeight);

myPicture.Placement = Excel.XlPlacement.xlMoveAndSize;

Problem is, the xlPlacement will not stick. The property remains as xlMove.
Even trying to force a change in the watch window deson't work.

Anyone knows what's going on (or whats wrong) here?

Thanks

BIG_j
 
More Information, if it helps...

This only happens when the "Shape" is not a standard in-built Excel Shape
 
In what way is 'ActiveSheet.Shapes.AddPicture(etc..' not a standard shape

Can you change the property manually, if so try changing
myPicture.Placement = Excel.XlPlacement.xlMoveAndSize;
to
myPicture.Placement = 1;

though not sure why that would fix if as you say xlMoveAndSize is found in
the library and works with a 'normal' shape.

Regards,
Peter T
 
Back
Top