I have a macro which is assigned to a dropdown box.
It deletes the current photo and inserts a new one based on their selection in the dropdown.
All the photos are different shapes and sizes but they all need to load into a certain place in the sheet.
The macro works like a dream in 2003 but in 2007 the photo appears as a big grey object in the middle of the sheet, blocking other data.
Obviously a compatability issue.
Anybody have any ideas? Here is the code:
ActiveSheet.Pictures.Delete
ActiveSheet.Pictures.Insert("c:\asset images\" & Range("B4").Value & "1.jpg").Select
With ActiveSheet.Shapes(ActiveSheet.Shapes.Count)
.LockAspectRatio = False
.Top = Range("l4").Top
.Left = Range("l4").Left
.Height = Range("l13").RowHeight
.Width = Range("p1").Width
End With
Selection.ShapeRange.ScaleWidth 6#, msoFalse, msoScaleFromTopLeft
Selection.ShapeRange.ScaleHeight 18, msoFalse, msoScaleFromTopLeft
It deletes the current photo and inserts a new one based on their selection in the dropdown.
All the photos are different shapes and sizes but they all need to load into a certain place in the sheet.
The macro works like a dream in 2003 but in 2007 the photo appears as a big grey object in the middle of the sheet, blocking other data.
Obviously a compatability issue.
Anybody have any ideas? Here is the code:
ActiveSheet.Pictures.Delete
ActiveSheet.Pictures.Insert("c:\asset images\" & Range("B4").Value & "1.jpg").Select
With ActiveSheet.Shapes(ActiveSheet.Shapes.Count)
.LockAspectRatio = False
.Top = Range("l4").Top
.Left = Range("l4").Left
.Height = Range("l13").RowHeight
.Width = Range("p1").Width
End With
Selection.ShapeRange.ScaleWidth 6#, msoFalse, msoScaleFromTopLeft
Selection.ShapeRange.ScaleHeight 18, msoFalse, msoScaleFromTopLeft