Skip to main content

How to export charts to graphics in Excel?

Author: Xiaoyang Last Modified: 2020-09-21

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 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 300 handy functions, makes your jobs more easier. 

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

1. Click Kutools Plus > 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

Best Office Productivity Tools

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...

Description


Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, 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!
Comments (2)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
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<br /> Paul
This comment was minimized by the moderator on the site
[quote]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<br /> PaulBy Paul001[/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<br /> If the problem persists, please try to contact me at jaychivo#extendoffice.com. Please replace # with @.
There are no comments posted here yet
Leave your comments
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations