JaysonHughes
New Member
- Joined
- Jul 13, 2022
- Messages
- 23
- Office Version
- 2021
- Platform
- Windows
This Question as been answered before but I'm unable to file a Code that works.
Sheet 15 = TOT Explanation Sheet
I need to Export A1:K33 with file name A2.JPG
On the Page is Just Text and 1 Pivot table.
I have this but the issue it that it is converting the Pivot table to image as well but this is not needed. :
Sub Export1()
Dim oWs As Worksheet
Dim oRng As Range
Dim oChrtO As ChartObject
Dim lWidth As Long, lHeight As Long
Set oWs = ActiveSheet
Set oRng = oWs.Range("A1:K33")
oRng.CopyPicture xlScreen, xlPicture
lWidth = oRng.Width
lHeight = oRng.Height
Set oChrtO = oWs.ChartObjects.Add(Left:=0, Top:=0, Width:=lWidth, Height:=lHeight)
oChrtO.Activate
With oChrtO.Chart
.Paste
oChrtO.Delete
.Export Filename:="\\ant\dept-eu\NCL1\Inbound\Chronos\Export1.jpg", Filtername:="JPG"
End With
End Sub
Sheet 15 = TOT Explanation Sheet
I need to Export A1:K33 with file name A2.JPG
On the Page is Just Text and 1 Pivot table.
I have this but the issue it that it is converting the Pivot table to image as well but this is not needed. :
Sub Export1()
Dim oWs As Worksheet
Dim oRng As Range
Dim oChrtO As ChartObject
Dim lWidth As Long, lHeight As Long
Set oWs = ActiveSheet
Set oRng = oWs.Range("A1:K33")
oRng.CopyPicture xlScreen, xlPicture
lWidth = oRng.Width
lHeight = oRng.Height
Set oChrtO = oWs.ChartObjects.Add(Left:=0, Top:=0, Width:=lWidth, Height:=lHeight)
oChrtO.Activate
With oChrtO.Chart
.Paste
oChrtO.Delete
.Export Filename:="\\ant\dept-eu\NCL1\Inbound\Chronos\Export1.jpg", Filtername:="JPG"
End With
End Sub