PC Review


Reply
Thread Tools Rate Thread

C# Interop Shape xlMoveAndSize property doesn't stick

 
 
BIG_j
Guest
Posts: n/a
 
      10th Oct 2007
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




 
Reply With Quote
 
 
 
 
BIG_j
Guest
Posts: n/a
 
      10th Oct 2007
More Information, if it helps...

This only happens when the "Shape" is not a standard in-built Excel Shape


"BIG_j" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>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
>
>
>
>



 
Reply With Quote
 
Peter T
Guest
Posts: n/a
 
      10th Oct 2007
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


"BIG_j" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> More Information, if it helps...
>
> This only happens when the "Shape" is not a standard in-built Excel Shape
>
>
> "BIG_j" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> >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
> >
> >
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[VBA] How to change the property of a line of a shape Peter Müller Microsoft Powerpoint 1 4th Feb 2011 08:21 AM
Using Shape's OnAction property in C# abhimanyu Microsoft Excel Programming 0 13th Sep 2007 10:17 AM
Changed shape names don't stick =?Utf-8?B?ZXQxMHls?= Microsoft Powerpoint 7 26th Aug 2007 03:47 PM
automatic shape property settings Luca Microsoft Excel Programming 2 12th Jul 2006 08:16 AM
COM interop and OcxState property Chris Microsoft C# .NET 0 12th Aug 2004 09:16 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:39 AM.