Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in
x
or
x
x
Register
x

or

How to export charts to graphics in Excel?

In Excel, sometimes, you may generate some charts from the data, so that the data looks more visual and direct. If you want to save or export the charts to graphics for some purpose, how could you do?

Export a chart to graphic with VBA code

Export multiple charts/pictures/shapes to graphics with Kutools for Excel good idea3


Export Range as Graphic

Kutools' Export Range as Graphic is aim to save or export a selection cells as multiple graphic formats.
doc export range as picture

Export a chart to graphic with VBA code


The following VBA code can help you to export a selected chart from the active worksheet as a picture. And the picture will be saved in the same location as the workbook you applied. Do as follows:

1. Select the chart that you want to export.

2. Then Hold down the ALT + F11 keys, and it opens the Microsoft Visual Basic for Applications window.

3. Click Insert > Module, and paste the following code in the Module Window.

VBA:Export chart to graphic

Option Explicit
Sub ExportChart()
Const sSlash$ = "/"
Const sPicType$ = ".gif"
Dim sChartName$
Dim sPath$
Dim sBook$
Dim objChart As ChartObject
On Error Resume Next
Set objChart = ActiveSheet.ChartObjects(1)
If objChart Is Nothing Then
MsgBox "No charts have been detected on this sheet", 0
Exit Sub
End If
If ActiveChart Is Nothing Then
MsgBox "You must select a single chart for exporting ", 0
Exit Sub
End If
Start:
sChartName = Application.InputBox("Please Specify a name for the exported chart" & vbCr & _
"There is no default name available" & vbCr & _
"The chart will be saved in the same folder as this file", "Chart Export", "")
If sChartName = Empty Then
MsgBox "You have not entered a name for this chart", , "Invalid Entry"
Goto Start
End If
If sChartName = "False" Then
Exit Sub
End If
sBook = ActiveWorkbook.Path
sPath = sBook & sSlash & sChartName & sPicType
ActiveChart.Export Filename:=sPath, FilterName:="GIF"
End Sub

4. Then press the F5 key to run this code, and enter the name for the exported chart in the prompt box, see screenshot:

doc-export-charts1

5. And then click OK, the selected chart has been exported to Gif format, and saved in the same location as the original file. See screenshot:

doc-export-charts2

With the above VBA code, you can only export one chart at a time, if you want to export other charts, please select other chart first, and then export it with the code.


Export multiple charts/pictures/shapes to graphics with Kutools for Excel

Kutools for Excel’s Export Graphics utility can export multiple charts, pictures or shapes at once in Excel.

Kutools for Excel, with more than 120 handy functions, makes your jobs easier. 

After installing Kutools for Excel, please do as below:(Free Download Kutools for Excel Now!)

1. Click Enterprise > Import / Export > Export Graphics, see screenshot:

doc export charts7

2. In the Export Graphics dialog box, all of the charts, pictures and shapes have been listed in the left list box, specify the type that you want to export, then click doc-button1 button to specify a directory to save the exported graphics, at the same time, you can choose the format of the pictures from the Export format as you need, such as GIF, JPEG, TIF or PNG.

doc-export-charts4

3. Then click OK, all the charts, pictures and shapes have been exported to the specified location successfully. See screenshots:
doc-export-charts5
-1
doc-export-charts6

Please click Export Graphics to know more about this feature.

Tip.If you want to export a range contens from workbook to a independent file, please try to use the Kutools for Excel’s Export Range to File as shown in the following screenshot. It’s full function without limitation in 60 days, please download and have a free trial now.

Export Range to File

doc export cell range to file


Recommended Productivity Tools for Excel

Kutools for Excel Helps You Always Finish Work Ahead of Time, and Stand Out From Crowd

  • More than 300 powerful advanced features, designed for 1500 work scenarios, increasing productivity by 70%, give you more time to take care of family and enjoy life.
  • No longer need memorizing formulas and VBA codes, give your brain a rest from now on.
  • Become an Excel expert in 3 minutes, Complicated and repeated operations can be done in seconds, 
  • Reduce thousands of keyboard & mouse operations every day, say goodbye to occupational diseases now.
  • 110,000 highly effective people and 300+ world-renowned companies' choice.
  • 60-day full features free trial. 60-day money back guarantees. 2 years of free upgrade and support.

Brings Tabbed Browsing and Editing to Microsoft Office, Far More Powerful Than The Browser's Tabs

  • Office Tab is designed for Word, Excel, PowerPoint and Other Office Applications: Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    Paul001 · 4 years ago
    Hi,

    I installed your addin and opened my excel and followed your tutorial.
    The export graphics button only brought up a small message box with no description. It did not bring up
    the Export Graphics dialog box.

    I have Excel 2007. If you can let me know why it is not working, really appreciate it.

    How to export charts to graphics in Excel?
    http://www.extendoffice.com/documents/excel/1151-excel-export-chart-to-image.html#a2

    Paul
    • To post as a guest, your comment is unpublished.
      admin_jay · 4 years ago
      [quote name="Paul001"]Hi,

      I installed your addin and opened my excel and followed your tutorial.
      The export graphics button only brought up a small message box with no description. It did not bring up
      the Export Graphics dialog box.

      I have Excel 2007. If you can let me know why it is not working, really appreciate it.

      How to export charts to graphics in Excel?
      http://www.extendoffice.com/documents/excel/1151-excel-export-chart-to-image.html#a2

      Paul[/quote]
      Hello, Please try to uninstall the Kutools for Excel from your Control Panel first.

      And then go to download and install the software from http://www.extendoffice.com/download/kutools-for-excel.html

      If the problem persists, please try to contact me at jaychivo#extendoffice.com. Please replace # with @.