Save a chart as a graphic file

Charts in Excel have become more and more functional and powerful since Excel began and now with Excel 2016 it seems incredible how innovative we can be with charts and mapping data onto Bing Maps. This quick description on how to export a chart from Excel as a .png file can be extremely valuable when you want your dynamic charts to be seen by others, but are not sure you want access to the chart and data in Excel where it can be so easily amended or corrupted inadvertently. With just a little bit of HTML knowledge you could export the charts using the code examples below and subsequently show these charts in a web browser that you give your team/colleagues access to.

The example below uses a for-next loop to export the first 10 charts (named 1 to 10) and save them as 1.png, 2.png…..etc in My Documents folder. Amend the code as you see fit for your project, or feel free to get in touch using the contact form or leave a comment below.


Sub Export_Chart_as_png
For n = 1 to 10
Worksheets(“Data”).ChartObjects(n).Activate
ActiveChart.Export “C:\My Documents\” & n & “.png”
Next n
End Sub


Contact us for some advice and guidance on how your Excel development could be created and start helping your business straight away. Contact Us

Datanology

Leave a Reply

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