Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 846
Default Adjusting the size of a picture

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adjusting Column Size carol Excel Discussion (Misc queries) 4 July 17th 08 06:45 PM
Chart Picture Size in UserForm/Picture Control. Dan Excel Programming 8 May 30th 08 08:04 PM
automatical cell size adjusting ninjaneer Excel Discussion (Misc queries) 4 April 21st 08 10:13 PM
Adjusting comment box size by Macro yshridhar Excel Discussion (Misc queries) 2 February 5th 08 09:19 AM
adjusting cell size in spreadsheets [email protected] Excel Discussion (Misc queries) 5 December 21st 05 05:59 PM


All times are GMT +1. The time now is 01:30 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"