Hello,
As the title goes this is as simple as it gets. The macro worked good when I was using excel 2003 but now that I have 2007 everything works for except the resizing (Picture.Width & Picture. Height).
I have tried to record some macros while I am resizing the pictures but to no avail the macros are blank.
Please help
Thanks!
As the title goes this is as simple as it gets. The macro worked good when I was using excel 2003 but now that I have 2007 everything works for except the resizing (Picture.Width & Picture. Height).
Code:
Sub AddImage()
Dim strPath As String
Dim strFile As String
Dim Picture As Object
Dim Response As String
Dim C As Range
strPath = "C:\\Photos\"
For Each C In Range("A1", Range("A65536").End(xlUp))
If C <> 0 Then
With C.Offset(0, 1)
Set Picture = Nothing
On Error Resume Next
Set Picture = Sheets("Raw Pix").Pictures.Insert(strPath & C.Value & ".jpg")
Picture.Top = .Top
Picture.Left = .Left
Picture.LockAspectRatio = msoTrue
[B] Picture.Width = 157
Picture.Height = 138[/B]
End With
End If
NextC:
Next C
End Sub
I have tried to record some macros while I am resizing the pictures but to no avail the macros are blank.
Please help
Thanks!