Sub save_to_jpg()
Dim MyChart As Chart
Dim objPict As Object
Dim RgCopy As Range
On Error Resume Next
Set RgCopy = Application.InputBox("Select the range to copy / Saveas", _
"Selection Save", Selection.Address, Type:=8)
If RgCopy Is Nothing Then Exit Sub
On Error GoTo 0
RgCopy.CopyPicture Appearance:=xlScreen, Format:=xlBitmap
ActiveSheet.PasteSpecial Format:="Bitmap"
Set objPict = Selection
With objPict
.CopyPicture 1, 1 ':=1
Set MyChart = ActiveSheet.ChartObjects.Add(1, 1, .Width + 8, .Height + 8).Chart
End With
'Bewaren in directory waarin je werkboek staat, als temp.jpg
With MyChart
.Paste
.Export ThisWorkbook.Path & Application.PathSeparator & "Temp.jpg"
.Parent.Delete
End With
'// opschonen van objecten en wis afbeelding op werkblad
objPict.Delete
Set RgCopy = Nothing
Set objPict = Nothing
End Sub