Adjusting the size of a picture

B

Brad

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
 
J

Joel

I used the macro recorder to get this line

Selection.ShapeRange.LockAspectRatio = msoFalse

so you should have

photo(c).ShapeRange.LockAspectRatio = msoFalse
 

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