How can I export a chart as a jpg/tif?

G

Guest

Hi there,

I regularly produce charts/graphs in Excel (2007), but need to export them
as a tiff or jpeg so that I can submit them to a scientific journal for
publishing (most publishers prefer images in this format).

Copying and pasting does not work, or if it does, the resolution is poor or
data is missing.

A previous posting on here had a response that mentioned an 'export' option,
but I cannot locate this.

I'd be really grateful for any advice.

Thanks in advance,

Tony.
 
J

Jon Peltier

In VBA the Chart object has an Export method, which can convert a chart to a
variety of raster formats. I would suggest not using JPG; depending on your
computer's settings you should also be able to export GIF, PNG, or TIF. Note
that the resolution of the image will match the screen resolution.

- Jon
 
G

Guest

Thanks John,
Unfortunately I cannot find the option in VBA to export the charts as a
gif/tif/png (though I admit I've never used VBA!).
I clicked on the developer tab, opened VBA, then right-clicked on one of the
charts in the left-hand pane, which opened a dialog box with the export
option. However, the only format I seem able to export as is the .cls
extension.
As you say, it may depend on my computer's setting, or maybe I need to know
more about VBA to do it.
Thanks anyway- I appreciate your time in replying.
Best wishes, Tony.
 
J

Jon Peltier

Tony -

You have to write code that uses the Chart.Export method.

You could also download John Walkenbach's Chart Tools utility
(http://j-walk.com), which includes an export feature.

- Jon
 
A

Andy Pope

Hi,

As Jon says you need VBA code to use the export method of a chart.

Here is the simplest set of steps to do that.

Select your chart object or sheet
ALT+F11 (takes you to VBE)
CTRL+G (open immediate window)
Enter the following syntax, changing path, filename and filter type as
required.

activechart.Export "C:\temp\mychart.tif","tif"

Press Return to execute command.

Here is an addin that provides export functionality
http://www.andypope.info/vba/gex.htm

Cheers
Andy
 
T

Tony B

Thank you both very much for your help with this- I can now export!
All the best, Tony
 

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