exp[orting charts as jpegs or pictures

sclapham

New member
Joined
Oct 25, 2012
Messages
3
Reaction score
0
Points
0
I have created a load of charts in excel but the artistic designer people dont like the resolutiom of the charts ine xcel and asked me to create jpegs or similar from them. I saved the workbook as a web page which created all the charts as pictures in .png files but they have all come out as compressed. I am now panicking to meet my deadline as I have 47 charts to make into pictures. Can anyone please help?
thanks
 
Do you know VBA? This routine should do it for you:

Code:
Sub ExportCharts()
Dim ws As Worksheet
Dim cobj As ChartObject
Dim oCht As Chart
Dim lCount As Long
For Each ws In ActiveWorkbook.Worksheets
    For Each cobj In ws.ChartObjects
        cobj.Activate
        Set oCht = ActiveChart
        On Error GoTo Err_Chart
        lCount = lCount + 1
        oCht.Export Filename:=ThisWorkbook.Path & "\Chart " & lCount & ".jpg", Filtername:="JPG"
    Next cobj
Next ws
Err_Chart:
    If Err <> 0 Then
        Debug.Print Err.Description
        Err.Clear
    End If
End Sub
 
hey thanks thats v kind
its far too complicated for me
I still cant print the lovely blue front cover of my report - get nasty white border all the way round
 
Back
Top