Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, and 2013. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Converting Charts to GIF Files.

Converting Charts to GIF Files

by Allen Wyatt
(last updated May 17, 2014)

1

Conrad has an Excel chart that he would like to share with others. He's determined that the best way for him to do this is to share it as a GIF image file. He isn't sure how to create a GIF file from an Excel chart, however.

There are a couple of things you can do to get the file you want. If you only need to create a GIF file once in a while, the best be would be to simply use a graphics program. For instance, you could follow these simple steps:

  1. Start a graphics program such as Paint.
  2. Switch back to Excel and display your chart as you normally would.
  3. Right-click the chart and choose Copy from the resulting Context menu. This copies the chart to the Clipboard.
  4. Switch to the graphics program.
  5. Press Ctrl+V to paste the chart into the graphics program.
  6. Make any changes to the image that you want.
  7. Save the image as a GIF file.

If you prefer, you could modify these steps a bit (well, steps 2 and 3) to capture an entire screen instead of just the chart. This allows you to size the chart any way you want prior to capture, even filling the entire screen, if desired. To capture the screen, just press the PrtScrn button on your keyboard, which places the screen capture in the Clipboard. You can then use steps 4 through 7 to put the screen into Paint and crop it or make other edits you need.

If you need to save your charts as GIF files quite often, then the best solution is to use a macro. The following simple macro saves the currently selected chart as a GIF file in the same directory in which the current workbook is stored.

Sub SaveChartAsGIF()
    Dim sFileName As String
    sFileName = ThisWorkbook.Path & "\" & ActiveChart.Name & ".gif"
    ActiveChart.Export Filename:=sFileName, FilterName:="GIF"
End Sub

The use of the Export method to save out charts is detailed in this Microsoft Knowledgebase article:

http://support.microsoft.com/?kbid=163103

The article indicates that it is written for Excel 97, but the coding will work just fine with all versions of Excel that use VBA.

If you want a more full-featured macro approach, this article on Jon Peltier's site is quite helpful:

http://peltiertech.com/WordPress/enhanced-export-chart-procedure/

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (9304) applies to Microsoft Excel 2007, 2010, and 2013. You can find a version of this tip for the older menu interface of Excel here: Converting Charts to GIF Files.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He  is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Returning a Value Based on Text Color

Conditional formatting rules can be used to adjust the way in which information is displayed in Excel, such as the text ...

Discover More

Adding Columns to Your Page Layout

Most documents are created using a single column of text. Word, however, allows you to use many, many columns in your ...

Discover More

Safely Relocking Forms

In order to use a form in Word, it must be protected. This means that you cannot make any changes to the form, even if you ...

Discover More

Solve Real Business Problems Master business modeling and analysis techniques with Excel and transform data into bottom-line results. This hands-on, scenario-focused guide shows you how to use the latest Excel tools to integrate data from multiple tables. Check out Microsoft Excel 2013 Data Analysis and Business Modeling today!

MORE EXCELTIPS (RIBBON)

Reordering the Display of a Data Series

Once you create a chart, you aren't limited to keeping the data series in the order they originally appeared. You can shift ...

Discover More

Setting Grid Line Intervals for a Radar Chart

Excel provides a wide varity of chart types you can use with your data. Unfortunately, this variety can often make it ...

Discover More

Changing Text in Text Boxes on a Chart

Macros allow you to make changes to virtually anything you can see in Excel. This tip examines how to make changes (even ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments for this tip:

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 3 - 0?

2014-06-23 11:58:21

Randy

How about when publishing to a web page? When publishing to a web page, the charts are saved as graphic files in a folder in the same directory as the html file. In Excel 2003, these graphic files are GIF format, in 2010, they are PNG. Is there a way to change 2010 so that it outputs in GIF?


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.

Links and Sharing