Private Sub CommandButton1_Click()
    Dim fichier As Variant, img As Picture
    On Error Resume Next
    ActiveSheet.Shapes("img").Delete
    Err.Clear
    fichier = Application.GetOpenFilename("Text Files (*.jpg), *.jpg", 1, "ouvrir un fichier")
    rot = GetImg_Orientation(fichier)
    MsgBox rot
    If fichier = False Then Exit Sub
    Set img = ActiveSheet.Pictures.Insert(fichier)
    img.Name = "img"
    place_l_image_dans [C5], img, Val(rot)
End Sub
Sub place_l_image_dans(Rng As Range, Shp As Picture, Optional rot As Long = 0)
    Dim x As Boolean
    With Shp
        .ShapeRange.LockAspectRatio = msoTrue    ' met  l'aspect Ratio a true
        x = (Rng.Width / Rng.Height) < (.Width / .Height)
         .ShapeRange.Rotation = rot
        'en fonction de x et en redimensionnant le width ou le height l'autre se redimensionne automatiquement
           If x Then .Width = Rng.Width Else .Height = Rng.Height
             'ci dessous ne fonctionne pas
             'If x Then .Width = IIf(rot < 0, Rng.Height, Rng.Width) Else .Height = IIf(rot < 0, Rng.Width, Rng.Height)
           .Left = Rng.Left    '+ ((Rng.Width - .Width) / 2)'débloquer si l'image doit etre au centre horizontalement
        .Top = Rng.Top    '+ ((Rng.Height - .Height) / 2)'débloquer si l'image doit etre au centre verticalement
        .Placement = 1
        End With
End Sub
Function GetImg_Orientation(fichier) As Long
   Dim Dossier$, img$, Fld As Object, Fich As Object
    Dossier = Mid(fichier, 1, InStrRev(fichier, "\") - 1)
    img = Mid(fichier, InStrRev(fichier, "\") + 1)
    Set shApp = CreateObject("Shell.Application")
    Set Fld = shApp.Namespace(Dossier)
    Set Fich = Fld.items.Item(img)
    GetImg_Orientation = -Val(Replace(Replace(Fld.getdetailsof(Fich, 245), "Pivoter de ", ""), " degrés", ""))
End Function