• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
    • Password Reset
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

Save Chart as Image

You are here: Home / Excel VBA / Save Chart as Image
save chart as image
November 30, 2018 by Philip Treacy

You might want to save your charts as images that can then be used in other applications, like email or displayed on a website.

Selecting a single image then copying/pasting or saving it, isn't too much bother. But if you want to do that for several images it quickly becomes tiresome.

I've written some VBA, and created a userform, that allows you to save any or all charts in your workbook as images.

When the userform is launched you'll see a list of all charts, in all worksheets, of the active workbook.

You can then click on whatever charts you like, and by clicking another button, all those charts are saved as images.

The Userform

I had previously written some code to export a single chart but I thought it would be much better to allow the user to see all the charts in a workbook and select the ones they wanted to save as images.

So I started desiging a form that ended up looking like this

Userform Showing Charts Found In Worksheets

When the form is displayed, the code behind it goes through all sheets and lists any charts it finds, showing you the sheet name, and the chart name.

By default the images will be saved to the same folder the workbook is in, but you can change this by clicking on the Browse button and choosing your own folder.

I've allowed the user to choose to save either as a PNG or a JPG, with PNG being the default. I pretty much always use PNG as the file size tends to be smaller than JPG.

To choose the chart(s) to save, just click on the chart name with your mouse. You can choose multiple charts using CTRL+Click or SHIFT+Click

Select charts to save as images

With charts selected, click on Export to save them.

Useful Chart Names

You can see from the image above that Excel gives charts generic names when it creates them.

Generic Chart Name

You also have the issue that you can have charts with the same name, on different sheets.

If you try to save two charts with the same name, you may overwrite one of them.

To make these names unique, and more descriptive, select the chart, then in the Name Box, type in your new name and hit Enter.

Chart With Useful Name

When you now display the form, the chart has its new name.

List Of Chart names

Download the Workbook

This sample workbook contains all the code and the userform to save your charts as images.

Enter your email address below to download a workbook containing this VBA code.

By submitting your email address you agree that we can email you our Excel newsletter.
Please enter a valid email address.

Download the Excel Workbook. Note: This is a .xlsm file please ensure your browser doesn't change the file extension on download.

save chart as image

More Excel Charts Posts

burn up burn down charts

Excel Project Management Burn Down and Burn Up Charts

Excel Burn Down and Burn Up Charts are easy to make with line or scatter charts. They are useful for monitoring the progress of a project.
wee people font charts

Excel WeePeople Font Charts

Excel WeePeople Font Charts are a nice change from generic shapes for waffle charts, bar/column charts and more.
excel dot map charts

Excel Dot Map Charts

Interactive Excel dot map charts are not built-in, but with some creative use of Excel’s built-in tools we can create something unique.
highlighting data in power bi visuals

Highlighting Data in Power BI Visuals

Learn several techniques to highlight or label important data points in your Power BI visuals. Sample file and code to download.
animating excel charts

Animating Excel Charts

Use animation correctly to enhance the story your data is telling. Don't animate your chart just for some eye candy. Sample code and workbook to download.
project management dashboard

Excel Project Management Dashboard

Excel project management dashboard video tutorial covering various techniques including conditional formatting, PivotTables, Slicers, charts and more.
jitter in scatter charts

Jitter in Excel Scatter Charts

Jitter introduces a small movement to the plotted points, making it easier to read and understand scatter plots particularly when dealing with lots of data.
Custom Excel Chart Label Positions

Custom Excel Chart Label Positions

Custom Excel Chart Label Positions using a dummy or ghost series to force the label position neatly above the columns of data
Lookup Pictures in Excel

Lookup Pictures in Excel

Lookup Pictures in Excel using values in cells returned by data validation lists (drop down lists) or Slicers. No VBA/Macros required!

Cross Highlight Excel Charts

Filter and Cross Highlight Excel Charts like you can in Power BI using some Excel Power Pivot magic, regular charts and a Slicer.

More Excel VBA Posts

automating and emailing pivot table reports

Automating and Emailing Pivot Table Reports

Automate the creation and distribution of pivot table reports with some VBA. Send reports to multiple email recipients using Outlook.
Checking values in range objects with vba

Checking Values in Range Objects With VBA

Use built in tools or your own code to examine the values contained within Range objects in VBA. Sample code to download.
Static variables in VBA

Static Variables in VBA

Variables normally cease to exist once your Sub or Function has ended. But Static Variables allow you to preserve values after your code has finished.
Clearing Downstream Dependent Data Validation Lists

Clear Downstream Dependent Data Validation Lists

Change one of your data validation lists and clear the values in the other data validation lists dependent on your first choice.
Excel Status Bar

Excel Status Bar

Use the Excel Status Bar to send messages to your users and to show a progress bar for your VBA code
Progress Bar for Excel VBA

Excel Progress Bar for VBA

Create your own progress bar for VBA in Excel. Use it to show that your code is still running, and how long before it finishes.
error handling in vba

Error Handling in VBA

Understand how Excel VBA generates errors, how to control what Excel does when an error occurs, and how to write your own error handling routines.
Finding File Metadata Using FileSystemObject

Finding File Meta Data Using FileSystemObject

Find file meta data like the creation date, last modified date and file size using Windows FileSystemObject in Excel VBA
Automatically Add Items to Data Validation List

Automatically Add Items to Data Validation List

Automatically Add Items to Data Validation List by typing in the new data. Then sort the source list for bonus points
Calculate end of period dates in Excel

Excel End of Period Dates

Calculating Excel End of Period Dates can be tricky if you don't use standard month ends. Here is a formula and UDF that solves the problem.

More Excel VBA Posts

Display All Matches from Search in Userform ListBox

Display All Matches from Search in Userform ListBox

Search a range for all partial and full matches of a string, and display matching records (entire rows) in a userform listbox. Sample code and userform.
animating excel charts

Animating Excel Charts

Use animation correctly to enhance the story your data is telling. Don't animate your chart just for some eye candy. Sample code and workbook to download.
dynamic data validation lists in userforms

Dynamic Data Validation Lists in Userforms

Data validation lists using the same source that are dynamically modified to prevent the same choice being made in each list.
show report filter pages for power pivot pivottables

Show Report Filter Pages for Power Pivot PivotTables

PivotTables created from Power Pivot can't use the 'Show Report Filter Pages' option. But this piece of VBA allows you to do just that.
charting real time data in excel

Charting Real Time Data in Excel

Receive data in real time and chart the data as it arrives. Can be used to chart things like stock prices or sensor readings. Sample code and workbook
select multiple items from drop down data validation list

Select Multiple Items from Drop Down (Data Validation) List

Choose multiple items from a data validation (drop down) list and store them all in the same cell. Sample workbook with working VBA.
Excel Calendar (Date Picker) to Use in Worksheets and Userforms

Multi-Language Excel Calendar (Date Picker) for Worksheets and Userforms

Easy to use, highly customizable and multi-language. This date picker is implemented as a userform that is simple to integrate into your workbook.
automating and emailing pivot table reports

Automating and Emailing Pivot Table Reports

Automate the creation and distribution of pivot table reports with some VBA. Send reports to multiple email recipients using Outlook.
search for data with userform

Searching for Data With a User Form

Search a list of records (like a table) using a user form, and then populate the fields of the search form when the record is found.
Checking values in range objects with vba

Checking Values in Range Objects With VBA

Use built in tools or your own code to examine the values contained within Range objects in VBA. Sample code to download.


Category: Excel VBATag: excel charts, Excel VBA
Previous Post:quickly formatting markers for dot plotsQuickly Formatting Markers for Dot Plots
Next Post:Excel Dynamic Arraysexcel dynamic arrays

Reader Interactions

Comments

  1. Tracy

    July 16, 2020 at 6:06 pm

    Hi Phillip,

    Awesome!

    It would be great to take this a step further. Let’s say you have a dashboard with charts and tables. Once you have sliced and diced, and charts are as per requirements, you now want to create a PowerPoint presentation. It would be useful to have PowerPoint open with a new presentation and all charts/objects pasted at the click of a button.

    Any idea if this is possible and the steps required?

    Reply
    • Catalin Bombea

      July 16, 2020 at 8:15 pm

      Hi Tracy,
      Yes, anything is possible.
      Using vba, we can check if there is a powerpoint document open, it can create one if needed.
      All depends on what you want to do: excel can look into a document to identify the pages where a specific image should go, and add the images there. A mapping will be needed, to associate excel objects with power point objects (usually, the power point document destination shape should have a tag added in Alt Text to allow programmatic identification of the shape).
      Cheers,
      Catalin

      Reply
  2. Josef

    June 29, 2020 at 4:11 am

    Excellent!
    I love the Save Chart As Image!
    I hope to expand it to create a basic PowerPoint application. Once complete (assuming I get it working) I’ll share and you can everyone how it should have been done.

    take care

    Reply
    • Philip Treacy

      June 29, 2020 at 5:57 pm

      Thx Josef

      Reply
  3. Niall Gallagher

    June 17, 2020 at 6:45 pm

    Hi There, I am getting a dll error when I try to access the VBA editor. Could you help?

    Reply
    • Philip Treacy

      June 18, 2020 at 7:46 am

      Hi Niall,

      Yes, if you can start a topic on the forum and supply details like the exact error message – a screenshot would be great – plus your workbook.

      Regards

      Phil

      Reply
  4. Dickson

    January 11, 2019 at 12:29 am

    Am gaining a lot from you. Keep it up!!!

    Reply
    • Catalin Bombea

      January 12, 2019 at 1:04 am

      Thanks Dickson, we are happy to hear that!
      Cheers,
      Catalin

      Reply
  5. Sunny Kow

    December 1, 2018 at 1:26 am

    Hi Philip

    A very handy utility.
    From my understanding (I could be wrong) Excel cannot save any images (except charts) in a workbook as a file.These images need to be “pasted” into a chart before it can be saved as a file.
    If you can merge these two functions together into your utility it will be great.

    Sunny

    Reply
    • Catalin Bombea

      December 1, 2018 at 1:10 pm

      Hi Sunny,
      When you insert a image, not necessarily in a chart, but in any sheet, the image is saved into the excel archive. Using vba, the excel archive can be opened with shell – namespace, and that xl/images folder from excel archive can be accessed and manipulated.
      Don’t see why the image should be in the workbook before pasting in a chart, the image can be accessed more easily from any folder.

      Reply
      • Sunny

        December 1, 2018 at 3:03 pm

        Hi Catalin

        That is very interesting.
        I will go explore on this option.
        Thanks a million.

        Sunny

        Reply
        • Sunny Kow

          December 3, 2018 at 4:29 pm

          Hi Catalin

          I tried 2 methods to extract the images from the file:
          Method 1 : Copy and rename the file as .zip
          Method 2 : Save the file as a web page

          Method 1 no problem.
          Method 2 there are 2 copies of each image created.Just curious to know why this is so.

          Reply
          • Catalin Bombea

            December 4, 2018 at 5:38 pm

            Hi Sunny,
            To open the excel archive you don’t need to copy the file or change the extension, just a simple right click-open with-(7zip, winrar, or windows explorer). Just make sure that the check box for “use this program as default application for this file type” is not checked.
            A web page needs different image sizes: thumbnails, small images, large images, to display an image in different contexts, such as preview, product pages. On mouse over action, some pages will automatically load the larger image, acting like a zoom. I guess you’ll have to check the sizes, they should not be the same.
            Catalin

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Current ye@r *

Leave this field empty

Sidebar

More results...

Featured Content

  • 10 Common Excel Mistakes to Avoid
  • Top Excel Functions for Data Analysts
  • Secrets to Building Excel Dashboards in Less Than 15 Minutes
  • Pro Excel Formula Writing Tips
  • Hidden Excel Double-Click Shortcuts
  • Top 10 Intermediate Excel Functions
  • 5 Pro Excel Dashboard Design Tips
  • 5 Excel SUM Function Tricks
  • 239 Excel Keyboard Shortcuts

100 Excel Tips and Tricks eBook

Download Free Tips & Tricks

Subscribe to Our Newsletter

Receive weekly tutorials on Excel, Power Query, Power Pivot, Power BI and More.

We respect your email privacy

Guides and Resources

  • Excel Keyboard Shortcuts
  • Excel Functions
  • Excel Formulas
  • Excel Custom Number Formatting
  • ALT Codes
  • Pivot Tables
  • VLOOKUP
  • VBA
  • Excel Userforms
  • Free Downloads

239 Excel Keyboard Shortcuts

Download Free PDF

Free Webinars

Excel Dashboards Webinar

Watch our free webinars and learn to create Interactive Dashboard Reports in Excel or Power BI

Click Here to Watch Now

mynda treacy microsoft mvpHi, I'm Mynda Treacy and I run MOTH with my husband, Phil. Through our blog, webinars, YouTube channel and courses we hope we can help you learn Excel, Power Pivot and DAX, Power Query, Power BI, and Excel Dashboards.

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook
 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate

Support

  • Contact
  • Forum
  • Helpdesk – For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.