Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to save bar chart from Microsoft Excel 2010 for using as jpg.

Is there a way for saving it?

share|improve this question

migrated from stackoverflow.com Apr 25 '12 at 3:37

This question came from our site for professional and enthusiast programmers.

    
Say more about your environment. Are you trying to do this in an external application? Or in a macro in Excel? Or within Excel itself? –  davehale23 Apr 23 '12 at 14:17
    
I want to save from Excel. –  ThanaDaray Apr 23 '12 at 14:26
2  
In VBA charts have an Export() method. –  Tim Williams Apr 23 '12 at 15:07

2 Answers 2

up vote 9 down vote accepted

Select the graph, hit copy (ctrl+c or right click and select copy) and then paste into paint (or any image editing software) to save in the correct format.

share|improve this answer
    
Is there any better way than that? –  ThanaDaray Apr 23 '12 at 14:18
1  
Also, selecting "Home/Clipboard/Copy->Copy As Picture" will give you the option of copying as-printed or as-shown-on-screen. The "on screen" option (suprisingly) appears to give a much higher resolution, if that is helpful... –  Rob I Apr 23 '12 at 14:19
1  
No, there is no native option to save a graph as a picture - which seems like an oversight in my opinion. –  unfrev Apr 23 '12 at 14:49
    
Ah! thank you... –  ThanaDaray Apr 23 '12 at 15:00
    
No problem at all. –  unfrev Apr 23 '12 at 15:04

As @TimWilliams noted in the comments, charts have an Export method in VBA. Here's a sample macro that will save the active chart as an image file in your workbook's directory.

The file type has been changed from the JPG you requested to PNG, which is a better image file format for line art like Excel charts. JPG is optimized for photographic images.

Sub savechart()
    ActiveChart.Export Filename:=ActiveWorkbook.Path & "\yourchart.png", Filtername:="PNG"
End Sub
share|improve this answer
    
Good suggestion about PNG format instead of JPG. –  Kamil Sep 7 at 0:50

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.