32

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.

2
  • Have you tried any of the methods described in that article? For instance, Excel -> PDF -> Inkscape -> SVG sounds promising. Which version of Excel do you have? 2007 and newer can save to PDF natively.
    – Indrek
    Apr 23, 2012 at 15:38
  • "Have you tried any of the methods described in that article? For instance, Excel -> PDF -> Inkscape -> SVG sounds promising. " No - it wasn't clear they were workable methods (e.g. that you could use Inkscape to convert PDFs to SVGs). "Which version of Excel do you have? 2007 and newer can save to PDF natively." I have Excel 2007, but how would I convert a PDF to an editable vector graphic? What program would I edit it in?
    – tog22
    Apr 23, 2012 at 15:52

11 Answers 11

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)
3
  • Office 2010 and above support exporting to pdf directly, no need to use a plugin. Office 2013 and above even support editing pdf files
    – phuclv
    Jun 4, 2014 at 2:12
  • Copy and paste into Inkscape works, but not as a vector! SVG can contain raster images, but it is very very different.
    – Lodewijk
    Jul 6, 2014 at 12:33
  • @Lodewijk, you need to do Paste Special and select Picture (Enhanced Metafile). I'm not sure about Inkscape but this is how it works in Corel Draw.
    – Simon
    Aug 23, 2014 at 2:56
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.
6
  • I don't see the EMF option under Edit > Paste special - though maybe I've copied the wrong thing. I've made this video of what I did so you can see if I'm following your instructions wrong: screencast-o-matic.com/watch/clf0DmCfd
    – tog22
    Apr 23, 2012 at 16:49
  • In Windows, it is written as "Picture (Enhanced Metafile)" under Paste-Special menu. So I think, in OSX, you should click on "Picture" and hopefully a further menu should come up which contains the Enhanced Metafile option. Apr 23, 2012 at 17:42
  • This is what I see on Windows: i.imgur.com/Oti8M.png Apr 23, 2012 at 17:43
  • On OS X it doesn't give any choice after 'Picture', and just pastes it as an uneditable bitmap. A strange platform discrepancy - I'll upvote your answer anyway because it'll help Windows users.
    – tog22
    Apr 24, 2012 at 8:29
  • Just use Crtl + V and Windows will automatically paste file as Enhaced metafile. The rest works great, thanks @Mehper C. Palavuzlar !!
    – maycca
    Sep 22, 2015 at 2:45
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.

5
  • Thanks, but there's not a Mac version. I guess I could run it in a Ubuntu VirtualBox, but will it import Excel files and their graphs? This is a non-negotiable part of my workflow, as people sometimes send me these and I won't have much luck getting them to switch programs...
    – tog22
    Apr 23, 2012 at 16:50
  • Yes, Gnumeric is able to import Excel files. I'm not sure about the details of Gnumeric's Excel support, since i myself use OpenOffice, but i expect a good level of support for xls files.
    – tohuwawohu
    Apr 24, 2012 at 5:23
  • Sounds cool, until I tried to download it: "We do not currently release or distribute Windows binaries." Why would someone using Excel (which is primarily used on Windows platforms) find this answer useful? Nov 2, 2019 at 14:57
  • @Fuhrmanator: Yes, the Gnumeric staff sadly stopped providing Windows builds. For people who still want to use Gnumeric (and other nice Linux applications) on a windows box, just create a virtual machine. Using VirtualBox, it's simple and free.
    – tohuwawohu
    Nov 2, 2019 at 19:44
  • @tohuwawohu Installing VirtualBox and Linux is not easier than installing Inkscape, as proposed in the other answer. Your answer is now misleading in terms of time (I realize it was not at the time you posted it, but sadly things change). Nov 2, 2019 at 20:10
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.

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.

2

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.

1
  • Best answer! Also works in Excel 2016 (both Mac and Windows).
    – CentAu
    Mar 8, 2016 at 6:21
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.

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.

2
  • 2
    Perhaps this is a recent update, but you can now save SVG directly from Excel. Select chart > Right-click > Save as Picture > Save as type. Jun 10, 2021 at 6:17
  • 1
    SVG support seems to be new since version 2011. Which includes adding "image/svg+xml" on the clipboard. stackoverflow.com/a/67799982/4139809 Jun 15, 2021 at 6:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .