# Increase resolution of Exporting a Chart as a Picture using VBA



## bofonomo (May 10, 2011)

Hi All,

I have used this VBA to export charts from my work sheet.  I will expland on this to export all charts, however when the charts are exported it exports a picture of the same size as the chart.  Which means when using it in a document the quality is not very good.

I have tried to get round this by increasing the size of the graph manually, but all the points stay the same size, and the font, so it'll mean I have to alter everything.  

Is there any way of just increasing the export size/resolution? 


Dim oCht As Chart
ActiveSheet.ChartObjects("Chart 3").Select
Set oCht = ActiveChart
On Error GoTo Err_Chart
oCht.Export Filename:="C:\Documents and Settings\All Users\Desktop\Chart1.png", Filtername:="png"

Err_Chart:
If Err <> 0 Then
Debug.Print Err.Description
Err.Clear
End If

Chears


----------



## DerekExcel (Dec 23, 2022)

You have to copy your chart as a picture (use oChart.Chart.CopyPicture xlScreen, xlPicture) and then pasting it into another blank chart. Then when you scale this new chart all the elements in the picture would also be scaled up.

Something like this:

```
oChart.Chart.CopyPicture xlScreen, xlPicture
                    DoEvents
                    lWidth = oChart.Width
                    lHeight = oChart.Height
                    Set chrt = ActiveSheet.ChartObjects.Add(Left:=0, Top:=0, Width:=lWidth, Height:=lHeight)
                    chrt.Activate
                    ActiveSheet.Shapes(chrt.Name).Line.Visible = msoFalse
                    ActiveSheet.Shapes(chrt.Name).Fill.Visible = msoFalse
                    DoEvents
                    
                    With chrt.Chart
                      .Paste
                      ActiveSheet.Shapes(chrt.Name).ScaleWidth 4, msoFalse, msoScaleFromTopLeft
                      ActiveSheet.Shapes(chrt.Name).ScaleHeight 4, msoFalse, msoScaleFromTopLeft
                      .Export strFname
                    End With
                    chrt.Delete
```


----------

