Hi all,
I'm using the following part of 'Biocie J's code to add pictures to a spreadsheet, format size and orientate for landscape, Problem being that if the picture gets rotated the handle position changes and the picture ends up either to the right or below where the insertion point (cell) is. Am I missing something or have the order incorrect? I've done a lot of searching and have not found a good explanation or way forward to remedy this.
Regards, Dave
I'm using the following part of 'Biocie J's code to add pictures to a spreadsheet, format size and orientate for landscape, Problem being that if the picture gets rotated the handle position changes and the picture ends up either to the right or below where the insertion point (cell) is. Am I missing something or have the order incorrect? I've done a lot of searching and have not found a good explanation or way forward to remedy this.
Regards, Dave
Code:
Private Sub InsertPics()
Dim myPicture As String, MyObj As Object
Dim Cnt As Variant
Dim shp As shape
Dim itm As Variant
'Biocie J Code
Worksheets("Tooling Transfer Form").Activate
ActiveCell.Activate
'Source of picture
myPicture = UserForm2.Tbo11.Value
If myPicture = "False" Then Exit Sub
Set MyObj = ActiveSheet.Shapes.AddPicture(myPicture, False, True, ActiveCell.Left, ActiveCell.Top, -1, -1)
' Check orientation for landscape
With MyObj
If MyObj.Rotation = 0 Or MyObj.Rotation = 180 Then
End If
If MyObj.Rotation = 90 Then
.IncrementRotation 90#
End If
If MyObj.Rotation = 270 Then
.IncrementRotation 90#
End If
'Unlock aspect ratio to fit in box and size
MyObj.LockAspectRatio = msoFalse
MyObj.Width = 217
MyObj.Height = 135
End With
Last edited: