Saving pictures with 300 DPI instead of 96... Is there a solution for this problem in 2018?

makiwara

Board Regular
Joined
Mar 8, 2018
Messages
171
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! :-)


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
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.

Forum statistics

Threads
1,223,894
Messages
6,175,254
Members
452,624
Latest member
gregg777

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top