Results 1 to 4 of 4

Thread: exp[orting charts as jpegs or pictures

  1. #1

    exp[orting charts as jpegs or pictures



    Register for a FREE account, and/
    or Log in to avoid these ads!

    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

  2. #2
    Administrator Ken Puls's Avatar
    Join Date
    Mar 2011
    Location
    Nanaimo, BC, Canada
    Posts
    2,294
    Articles
    57
    Blog Entries
    14
    Excel Version
    Excel Office 365 Insider
    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
    Ken Puls, FCPA, FCMA, MS MVP

    Learn to Master Your Data at the Power Query Academy (the world's most comprehensive online Power Query training), with my book M is for Data Monkey, or our new Power Query Recipe cards!

    Main Site: http://www.excelguru.ca -||- Blog: http://www.excelguru.ca/blog -||- Forums: http://www.excelguru.ca/forums
    Check out the Excelguru Facebook Fan Page -||- Follow Me on Twitter

    If you've been given VBA code (a macro) for your solution, but don't know where to put it, CLICK HERE.

  3. #3
    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

  4. #4
    Administrator Ken Puls's Avatar
    Join Date
    Mar 2011
    Location
    Nanaimo, BC, Canada
    Posts
    2,294
    Articles
    57
    Blog Entries
    14
    Excel Version
    Excel Office 365 Insider
    Have a quick look at this article. It tells you where to put the code I gave you.
    Ken Puls, FCPA, FCMA, MS MVP

    Learn to Master Your Data at the Power Query Academy (the world's most comprehensive online Power Query training), with my book M is for Data Monkey, or our new Power Query Recipe cards!

    Main Site: http://www.excelguru.ca -||- Blog: http://www.excelguru.ca/blog -||- Forums: http://www.excelguru.ca/forums
    Check out the Excelguru Facebook Fan Page -||- Follow Me on Twitter

    If you've been given VBA code (a macro) for your solution, but don't know where to put it, CLICK HERE.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •