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

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

Forum statistics

Threads
1,214,808
Messages
6,121,681
Members
449,048
Latest member
81jamesacct

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