Hi!
The following code saves a picture from excel. (A1 - I18, then A18-I35 and so on...) It's working fine.
However, I can't solve the 300 DPI question. (I use Office 2016)
I have read about ideas that maybe using Power Point could be a solution.
Could somebody help me out?
Thank you very much, it means a lot to me! Have a very nice day!
The following code saves a picture from excel. (A1 - I18, then A18-I35 and so on...) It's working fine.
However, I can't solve the 300 DPI question. (I use Office 2016)
I have read about ideas that maybe using Power Point could be a solution.
Could somebody help me out?
Thank you very much, it means a lot to me! Have a very nice day!
Code:
Sub Export()
STEPP = 17
Dim oWs As Worksheet
Dim oRng As Range
Dim oChrtO As ChartObject
Dim lWidth As Long, lHeight As Long
Dim i As Integer
Dim k As Integer
k = 0
For i = 1 To 510 Step STEPP
k = k + 1
Set oWs = ActiveSheet
Set oRng = oWs.Range("A" & i, "I" & i + STEPP)
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
' .Export Filename:="Case.jpg", Filtername:="JPG"
.Export Filename:="C:\Users\xx\Desktop\mapname\" & "pic" & k & ".jpg", Filtername:="JPG"
'C:\Users\HYMC\Desktop\XLName.xls
End With
oChrtO.Delete
Next
End Sub