View Single Post
 
Old 06-12-2014, 11:11 AM
exceere exceere is offline Windows 7 64bit Office 2007
Novice
 
Join Date: Jun 2014
Posts: 7
exceere is on a distinguished road
Default (.left property) and (LockAspectRatio) don't work

Hi,

In need help …

I have macro to insert picture into a sheet:

Code:
Sub Gen_InsertPicture()
Dim sPicture As String, pic As Picture
FilterPics = "All Pictures, *.gif;*.jpg;*.jpeg;*.jpe;*.bmp;*.png;*.tif"
sPicture = Application.GetOpenFilename(FilterPics, , "select picture")
If sPicture = "False" Then Exit Sub
Set pic = ActiveSheet.Pictures.Insert(sPicture)
With pic
.ShapeRange.LockAspectRatio = msoTrue
'.Height = Selection.Offset(Selection.Rows.Count, 0).Top - Selection.Top
.Width = Selection.Offset(0, Selection.Columns.Count).Left - Selection.Left
.Top = Selection.Top
.Left = Selection.Offset(0, Selection.Columns.Count).Left - .Width
.Placement = xlMoveAndSize
End With
Set pic = Nothing
If ActiveSheet.CodeName = "Sheet9" Then
    With Range("DrwgArea").Interior
        .Pattern = xlNone
    End With
End If
End Sub
why LockAspectRatio Not work perfectly in R-L and L-R sheets?

the file is Attached

Attached Files
File Type: xlsm InsertImage.xlsm (34.1 KB, 12 views)
Reply With Quote