Sub test()
exportRangeToJpg Feuil1.[c5:E18]
End Sub
Private Sub exportRangeToJpg(Rng)
Dim chemin
Application.ScreenUpdating = False
chemin = Application.GetSaveAsFilename(InitialFileName:=CurDir, filefilter:="image Files (*.jpg), *.jpg", Title:="ENREGISTREMENT DE LA CAPTURE")
If chemin <> False And Not Rng Is Nothing Then
Rng.CopyPicture
Set chart1 = Rng.Parent.ChartObjects.Add(0, 0, Rng.Width, Rng.Height).Chart
With chart1
With .Parent
T = Timer: Do: DoEvents: Loop While Timer - T < 1
.Chart.Paste
Do: DoEvents: Loop While .Chart.Pictures.Count = 0
.Chart.Export chemin, "jpg"
.Delete
End With
End With
End If
End Sub