Hi,
I have a problem - I am using this code to add a picture via a dialog box, it inserts my picture in my defined are, but distorts the image:
Sub InsertPicUsingShapeAddPictureFunction_Pump16()
Dim profile As String
On Error GoTo 0
Dim fd As FileDialog
Set fd = Application.FileDialog(msoFileDialogFilePicker)
With fd
.Filters.Clear
.Filters.Add "Picture Files", "*.bmp;*.jpg;*.gif;*.png"
.ButtonName = "Select"
.AllowMultiSelect = False
.Title = "Choose Photo"
.InitialView = msoFileDialogViewDetails
.Show
End With
ActiveSheet.Shapes.AddPicture Filename:=fd.SelectedItems(1), _
LinkToFile:=msoFalse, _
SaveWithDocument:=msoCTrue, _
Left:=ActiveSheet.Range("pump16").Left + 2, _
Top:=ActiveSheet.Range("pump16").Top + 2, _
Width:=815, _
Height:=357
End Sub
How can i maintain the original aspect ratio of the image in my existing code?
Thanks!
Bookmarks