ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Unlocking Aspect Ratio For images (https://www.excelbanter.com/excel-programming/429221-unlocking-aspect-ratio-images.html)

ironhydroxide

Unlocking Aspect Ratio For images
 
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

Peter T

Unlocking Aspect Ratio For images
 
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

"ironhydroxide" wrote in message
...
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




ironhydroxide

Unlocking Aspect Ratio For images
 
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

Peter T

Unlocking Aspect Ratio For images
 
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



"ironhydroxide" wrote in message
...
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





All times are GMT +1. The time now is 10:36 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com