Unlocking Aspect Ratio For images

I

ironhydroxide

I am wondering how one Unlocks the aspect ratio for inserted images. The
2007 Macro recorder was poorly designed in comparison with 2003. (it seems
like it is missing alot) anyways it doesnt record the changes in size and
properties of the image when i record then manually change the properties
(uncheck Lock Aspect Ratio).

Thanks in Advance

Ironhydroxide
 
P

Peter T

Some aspects of the macro recorder appear not to have been designed at all,
yet only badly!

courtesy of 2003 -
Selection.ShapeRange.LockAspectRatio = msoFalse / msoTrue

or
myShape.LockAspectRatio = bFlag

Regards,
Peter T
 
I

ironhydroxide

Tried, and failed, (i am not so sure I like the changes in 2007)
Any other suggestions

Wait, One change (just thought of)
With ActiveSheet.Cells(PopRow, PopCol)
Set yourPic = ActiveSheet.Pictures.Insert(Picstring)
yourPic.ShapeRange.LockAspectRatio = msoFalse
yourPic.Width = Cells(PopRow, PopCol).Width
yourPic.Height = Cells(PopRow, PopCol).Height
yourPic.Top = Cells(PopRow, PopCol).Top
yourPic.Left = Cells(PopRow, PopCol).Left
End With


Thank you 2003 recorder.

and thanks for doing that for me, i have no access to 2003
 
P

Peter T

Before posting I tested LockAspectRatio in 2007 and it worked fine, both at
drawing-object level and to a shape object. At a glance your code below
should also work fine. You could also try Shapes.AddPicture

AddPicture(Filename As String, LinkToFile As MsoTriState, SaveWithDocument
As MsoTriState, Left As Single, Top As Single, Width As Single, Height As
Single) As Shape

Regards,
Peter T
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top