View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
NickHK NickHK is offline
external usenet poster
 
Posts: 4,391
Default Resize the image in excel 2007

I don't use the 2007 version, but maybe look into the LockAspectRatio
property.

NickHK

"Akader" wrote in message
...
thank s Dave

same problem for this code also, it's only adjust Height size , i need

from
the code to adjust the Width & Height dynamically same as the row & column
size


"Dave Peterson" wrote:

You may want to just include the part of the code that actually matters

to see
if that helps.

(Untested)

Option Explicit
Sub GetPhotoone()

Dim rng As Range

Set rng = ActiveCell
myPictName = rng.Value

Set myPict = .Parent.Pictures.Insert(Filename:=myPictName)

myPict.Top = rng.Top
myPict.Left = rng.Left
myPict.Width = rng.Width
myPict.Height = rng.Height
myPict.Name = "Pict_" & .Cells(1).Address(0, 0)

End Sub


Rng was set to the activecell. All that other stuff didn't really

matter (and
didn't compile for me in xl2003).