Saving chart as png file >72ppi

S

Stan Hadley

I've noticed that Excel 2004 now has the capability to directly save a chart
as a png file by control-clicking on it. This is nice since currently I go
through a process of:
copy the chart,
open GraphicConverter,
create new file from clipboard (cmd-j)
Save file as .png

This allows me to insert charts into Word in a compact form that is
cross-platform.

However, Excel's new method only saves the file at 72 ppi, which is
inadequate for inserting into a Word document for later publication. (The
GraphicConverter method saves it at 300 ppi.) Even if I change the Web
Options in the Excel preferences to 300 ppi, the graph stays at 72.
Apparently the Web Options number only applies to graphics such as WordArt.
Does anyone know how to change the parameter to 300 ppi for charts?

Thanks for any help,

Stan Hadley
 
J

Jim Gordon MVP

Hi Stan,

If a graph is on a "chart worksheet" then it will always be saved at
72dpi regardless of the method you use to save it as a picture file.

From the menu choose Chart > Location and change the location to a
worksheet. Unfortunately, it will still save at 72dpi if you use the
control-click method. But if you use the Save As Web Page feature, you
can click the Web Options button and specify a higher number of dpi as
the resolution for the graph. Yes, this method creates a few extra files
along the way, but at least you can get a higher quality picture. You
can also get a bigger picture this way by simply making the graph bigger
before you save it as a web page.

The ability to change the resolution and size of the new Save As Picture
feature is a "must have" feature request IMHO. That would make the great
new feature even better.

-Jim
 
S

Stan Hadley

Jim,

Thanks for pointing out about the Save as Web Option on the whole sheet.
That does allow the chart to be at a decent dpi. It still does a little
funny with the size of text on the labels, shrinking them on the one test I
tried, but I'll play with it a little more.

Stan
 
J

Jim Gordon MVP

Hi Stan,

I figured out how to get 300 dpi in PNG.

Here's what to do:

Copy a graph (use the toolbox button on the menu to open the scrapbook if
you have more than one to do).

Switch to PowerPoint. In a blank slide paste the graph.
Stretch the graph to fit the window nicely
From PowerPoint's menu choose File > Save As > PNG
Click the Options button and adjust the resolution to 300dpi
Click OK then click Save.

You'll get a nice picture of your graph saved at 300 dpi.

-Jim

--
Jim Gordon
Mac MVP

MVPs are not Microsoft Employees
MVP info
 
S

Stan Hadley

Thanks! It's good to know that they have the dpi options working in
Powerpoint at least. I may use that option, or stick with pasting into
GraphicConverter instead.
....
I just played with a graph in Powerpoint, and this does get the 300 dpi;
only problem is that it gets the whole slide. (Saving the picture only goes
back to the 72 dpi.) This can be cropped down later if need be, but I think
I'll just stay with my current procedure.

What I'm basically doing is finding the best way to get Excel charts into
Word documents that are good-looking on both Mac and PC (on both screen and
paper) and are compact, consistent, and self-standing. Since my graphs come
from large Excel workbooks I can't just paste in the object for that puts
the whole spreadsheet into the paper for each graph. Doing a copy and paste
as picture doesn't work well because non-horizontal text does not carry over
well to the PC and if you double-click on the picture in Word it rearranges
all the text blocks on the graph.

That's when I went to using GraphicConverter (GC) as an intermediary. I
tried copying from Excel and pasting the contents of the clipboard into GC,
then selecting all and pasting that as a picture into Word. That works well
except for on the screen on the Mac. Some lines are too fine and so don't
show up on the screen. That's when I finally went with the Paste into GC and
save as PNG, then insert file into Word. It creates extraneous intermediate
files but otherwise works well.

Stretching graphs to fit can cause problems with font sizes and shapes. In
Excel I've set up a macro that will ask the user for the desired dimensions
of the chart on the worksheet. That way I keep things like font sizes
consistent between graphs (versus stretching the graph to fit later). This
might help others who are trying to work out this problem. The width and
height equations might need fudge factors to get exactly the right values.)

Stan

'
' ChartSize Macro
' Change embedded chart size within sheet
'Control+Shift+C
'
Sub ChartSize()
wdvalue = Application.InputBox(prompt:="What width? (in inches)",
Title:="Width ", default:=6.5, Type:=2)
If wdvalue = False Then Exit Sub
htvalue = Application.InputBox(prompt:="What height? (in inches)",
Title:="Height ", default:=3.5, Type:=2)
If htvalue = False Then Exit Sub
ActiveChart.Parent.Width = (wdvalue * 72)
ActiveChart.Parent.Height = (htvalue * 72)
End Sub
 
J

Jim Gordon MVP

Hi Stan,

There's yet another option to explore.

Create a graph worksheet in Excel.
Save this file (it will be the data source for linked data).
From the Edit menu chose Move or Copy Sheet
In the "To" section choose "New Workbook"
In the new workbook use File>Save As to save the new workbook. Click OK
if asked about references.
Next, use File>Save As a second time, but this time change the the file
format to "Excel 4.0 chart." Save the file with a .xlc file extension.

You can close all the open documents in Excel.

Now in Excel from a blank workbook choose Insert > Object and in the
dialog box click From File. Navigate to the .xlc file you saved.

Do the same thing in Word.

What I am hoping is that you will see that a file in .xlc format can be
put into Word, Excel, or PowerPoint and you can preserve the formatting,
etc. Whether this fits into your plans or not, I don't know. But maybe!

-Jim


--
Jim Gordon
Mac MVP
MVP FAQ
<http://mvp.support.microsoft.com/default.aspx?scid=fh;EN-US;mvpfaqs>
 
S

Stan Hadley

Jim,

I see you're a man after my own heart. I don't know how many hours I've
played with trying to figure the easiest way to have graphs to simply be
available, consistent, and readable from Mac to PC.

Your method below works ok, but for a few problems. When switching a graph
from .xls to .xlc, the colors all change; I guess from different settings in
Excel and in Graph. When I insert the .xlc as an object into Word I need to
resize the window. Fortunately I had already set up a macro in Excel (which
launches when I double-click on the graph) to change window sizes similar to
the macro I described below. That got the graph looking good in Word (but
for the earlier color shift).

Next I transfer the Word doc to my PC and open it. Unfortunately, we get
back to the missing vertical text on the y-axis. I can then double-click on
it to open the graph in Excel, but then the size changes again and I have to
expand it on the PC.

If I'm sending the document to colleagues with a PC to review it, I can't
expect them to do the double-click and resize on every graph in the report
in order to see the text correctly. So I think I'll just stick to .png files
through GraphicConverter where I can then lock in the characteristics that I
want. One nice thing I did notice in Excel 2004, is that it doesn't
anti-alias the fonts when I copy and paste anymore, if I turn it off. Excel
v.X had a problem with anti-aliasing carrying over into the graphic and
making it look fuzzy.

Stan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top