View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default Adjusting the size of a picture

I used the macro recorder to get this line

Selection.ShapeRange.LockAspectRatio = msoFalse

so you should have

photo(c).ShapeRange.LockAspectRatio = msoFalse

"Brad" wrote:

I have the following code to insert photos into a workbook. I want to be able
to stretch the photo to fill up the range. The following code works great at
inserting the pictures, but I think that the aspect ratio of the photo is
locked so the picture doesn't stretch to fill the area. Is there anyway to
change that?

Workbooks("Dots").Activate
For c = 1 To 5
Sheets("Sheet" & c).Activate
Range("A42").Select
Set photo(c) = ActiveSheet.Pictures.Insert(picLocation(c))
With photo(c)
.Top = ActiveCell.Top
.Left = ActiveCell.Left
.Width = ActiveCell.Offset(14, 46).Left - .Left
.Height = ActiveCell.Offset(14, 46).Top - .Top
End With
Next