I\'m trying to get a jpg file from a specific range in excel
I\'m currently getting the
1004 Runtime error on Range method from _Worksheet ob
Here is how to export in the same path as the workbook :
Sub Export()
Dim ws As Worksheet
Dim Rng As Range
Dim Chrt As Chart
Dim ExportPath As String
Set ws = ActiveSheet
Set Rng = ws.Range("B2:H11")
ExportPath = ThisWorkbook.Path & "\Case.jpg"
Set Chrt = ThisWorkbook.Charts.Add
Rng.CopyPicture xlScreen, xlBitmap
With Chrt
.Paste
.Export FileName:=ExportPath, Filtername:="JPG"
End With
End Sub