33

How can I export a graph generated in Excel as an editable vector graphics file, e.g. a SVG?

When I right click on a graph in Excel the 'Save as Picture...' option only gives non-vector formats (like PNGs and JPGs) as options.

The only resource I've found on this is http://www2b.abc.net.au/science/techtalk/newposts/790/topic790744.shtm where no one gives a real answer. Just like the questioner there, I don't mind if it's a multi-step process eg. Excel -> Open Office -> SVG or Excel -> pdf -> SVG.

tog22
  • 972
  • 3
  • 12
  • 21

11 Answers11

14
  1. Select your Microsoft Excel plots.
  2. Copy.
  3. Open Microsoft PowerPoint.
  4. Paste-special as enhanced metafile (EMF) into an otherwise empty slide.
  5. Save your PowerPoint slide as an "other format" file, and choose "EMF" (Enhanced Windows Metafile).
  6. Import your EMF file into InkScape and ungroup the object.
  7. Delete all the A4-sized crappy blank space from the image and enjoy.
13

Though you can indeed copy-'n-paste directely into InkScape you might lose some formatting in the process. Exporting to PDF ensures that the background of your Excel file will be retained as well. Works very well in my experience.

  1. In Microsoft Excel, "Save as PDF".
  2. In Inkscape "Open PDF".
  3. Document properties, expand "Resize page to content" (hiddent), click button.
  4. Save to SVG or Enhanced Meta-file (emf).

Plugins for PDF export.

  1. 2007 Microsoft Office Add-in: Microsoft Save as PDF or XPS - "FileFormatConverters.exe" (37 MB)
  2. Additional Add-in that creates new menu option "save as pdf" in Excel - "SaveAsPDFandXPS.exe" (933 KB)
iBurger
  • 146
7

Try Gnumeric. It supports exporting graphs to SVG natively. There's a windows version, too. So, the toolchain would be Excel -> Gnumeric -> SVG, or even Gnumeric -> SVG without using Excel. IMHO it's the easiest way to get your graph in SVG.

tohuwawohu
  • 11,143
4

Using Excel 2007 under Windows XP, I also discovered that copied graphs get pasted as bitmaps in Inkscape. This is different than the behaviour of Excel 2003 on Windows 7.

I found a workaround -- if you select the cells surrounding the graph (which would include the graph as well) and copy, you can paste a vector graphic in Inkscape just as expected. The only slight downside is that you have to manually remove the grid of excel cells which is left below your graphics.

Alex G
  • 131
3

Newer versions of PowerPoint allow you to Save&Send as PDF. Use that feature to create a PDF file, then open that in Inkscape and edit by ungrouping, then resize the page to the drawing and save as SVG.

drott
  • 201
  • 2
  • 3
3

You could try to just copy a graph (Ctrl-C) and paste it in Inkscape (and then save as SVG). It worked for me on Excel 2003, Inkscape (0.48.4) and Windows Vista (Borrowed computer), as at least in Windows the default copy-format seems to be EMF. But then I guess the OS X Clipboard may handle this differently and copy/paste a bitmap instead.

2

To avoid the "crop the PDF" step mentioned in several answers, you can put the chart on its own Worksheet with an appropriate paper size and zero margins. E.g. in Windows Excel 2007:

  1. Select chart, from pop-up menu choose Move Chart... | New Sheet
  2. On the new Chart Sheet, Page Layout | Margins | Custom Margins, and zero all
  3. Resize the chart to the desired size by dragging its bottom-right corner
  4. See the resulting size from Chart Tools | Format | Size
  5. Select a close size from Page Layout | Size, and adjust as necessary

If there is no size close enough, or you want to be exact, you'll need to create a custom page size. Unlike Word, Excel doesn't let you do that itself, but rather uses the size from the printer driver.

  1. Page Layout | Size | More Paper Sizes | Print..., select a printer whose driver lets you create custom page sizes - most normal PostScript or PDF drivers do
  2. Options... | Advanced... | Paper Size | PostScript Custom Page Size
  3. Set the size, taking care to get the units right and swap width and height (Excel prints as landscape by default)

It may be best not to have an outline around the chart in the PDF itself: you can choose Format Chart Area | Border Color | No Line.

stevek_mcc
  • 1,229
  • 1
  • 12
  • 12
2

Here is a method using Excel and Powerpoint for Windows. Copy the graph to the clipboard in Excel using the copy command in the home tab of the ribbon. Past special into a blank slide in Powerpoint using the Paste menu in the ribbon. Scroll down and select "Picture (enhanced metafile)" from the drop down menu in the dialogue box. Then click OK The graph appears in Powerpoint. Make sure the graph is selected then go to Arrange > Ungroup. A dialogue box will appear... "This is an imported picture, not a group. Do you want to convert it to a Microsoft Drawing Object?" click yes You are almost there! Make sure the grahp is still selected. Go back to Arrange > Ungroup and click All of the elements of the graph should now be Powerpoint vector objects. Cheers, enjoy.

1

I can recommend this Excel plugin: XL Toolbox

It allows to export charts directly as EMF file, which can be converted with Inkscape to SVG.

1

Here is my workflow on Mac OS X running Excel 2011.

  1. Right-click the chart and select "Save as Image". Save it as a PDF.
  2. Open the PDF in Adobe Acrobat.
  3. Go to File > Save As > More Options > Encapsulated PostScript. Save.

The EPS file can then be opened in your favorite vector editor like Illustrator.

Note that you can also place the PDF directly into your Illustrator document, but in my case any text in the image was turning into garbage. If your chart does not have a large amount of text, a better option might be skipping the EPS step (which turns the font into paths) and manually correcting the garbage text in Illustrator's PDF import.

sffc
  • 417
0

Quick update to this question since it was high up on a search.

You can now copy an Excel chart, paste into PowerPoint as an Enhanced Meta File and then Save as SVG directly in versions of Office since early 2020.

Julian Knight
  • 14,749
  • 3
  • 31
  • 46