Sub plaatje_inlezen_in_excel()
'plaatje inlezen op links boven op 10.10
Dim ImgFileFormat As String, pic As Variant
On Error Resume Next
Application.DisplayAlerts = False
'Set rng = Application.InputBox("Selecteer bereik", "Foto invoegen", , , , , , 8)
ImgFileFormat = "Image Files jpg (*.jpg),*.jpg,(*.bmp),others, tif (*.tif),*.tif, tiff (*.tiff),*.tiff"
Set pic = ActiveSheet.Pictures.Insert(Application.GetOpenFilename(ImgFileFormat))
If Not pic Is Nothing Then
With pic
'.Height = rng.Height
'.Width = rng.Width
'.Left = rng.Left
.Left = 10
'.Top = rng.Top
.Top = 10
.Placement = xlMoveAndSize
End With
Else: Exit Sub
End If
'Plaatje dimensioneren op breedte 400 de hoogte is afhankelijk van de hoogte van het plaatje
Dim plaatje As Object
Dim verhouding As Double
For Each plaatje In ActiveSheet.Pictures
verhouding = plaatje.Height / plaatje.Width
plaatje.Height = verhouding * 400
plaatje.Width = 400
Next plaatje
Application.DisplayAlerts = True
End Sub