12

After I have created a plot in Excel , is there a way to export the plot to SVG while retaining the explicit characters and vector strokes. (I do not want to have to capture the screen and export).

UPDATE: I do not want to export in some complex and potentially lossy format such as PDF or Word. The graphics strokes are there in PDF, I just want to get them out. Also I don't want to dump as CSV and replot using some other tool.

peter.murray.rust
  • 37,407
  • 44
  • 153
  • 217
  • Pretty sure SVG Is not one of the format options, but charts have an Export method for which png is one of the supported formats... – Tim Williams Mar 17 '13 at 01:18
  • Thanks - My primary purpose is a simple way where Excel users can dump a graph in re-usable form. Sounds like it's not there – peter.murray.rust Mar 18 '13 at 08:20

6 Answers6

4

2023 Update

This is now easily possible.

Exporting manually:

Just right-click the chart and select "Save as Graphic" where you have the option to save as .svg.

Exporting with VBA

With ThisWorkbook.Worksheets("Sheet1")
    .ChartObjects("Chart 1").Chart.Export FileName:="path\name.svg", _
                                          FilterName:="SVG"
End With

See documentation.

Note that this method of exporting was bugged in some older versions of Excel and resulted in an empty file on those. Therefore, exporting with VBA was more difficult on those bugged versions, for a workaround, see here.

GWD
  • 3,081
  • 14
  • 30
2

If you 'Print to PDF' you should be able to convert it to SVG-format. There's several converters online, I would use Adobe Illustrator though.

2

I think you have set yourself a very difficult task.

If you copy a plot area to the clipboard and look at the formats available with Application.ClipboardFormats, the only vector format offered is PICT. Perhaps this could be an avenue to investigate...

grahamj42
  • 2,752
  • 3
  • 25
  • 34
  • Here's some information about retrieving from the clipboard: http://stackoverflow.com/questions/8614910/paste-from-excel-into-c-sharp-app-retaining-full-precision and here about the PICT format: http://developer.apple.com/legacy/mac/library/documentation/mac/QuickDraw/QuickDraw-458.html Google provided a link to a PICT to SVG convertor, but it's a Mac app and I don't think the source is available. – grahamj42 Mar 16 '13 at 17:54
  • Is this only for Excel on the Mac? FWIW I could probably hack Pict2SVG but I wanted something simple. If it doesn't exist, it's not worth pursuing. – peter.murray.rust Mar 16 '13 at 18:26
  • No, I looked at the clipboard formats which were available on Excel 2003 and 2007 under Windows (I don't have a Mac). – grahamj42 Mar 16 '13 at 18:29
1

Copy it as a plot into powerpoint. Save in powerpoint as a emf. Open the emf in e.g. inkscape, then save as svg. Vectors are preserved.

0

Save to PDF and operate it with InkScape which is totally free and sharing similar function to Illustrator.

0

Solution is simple, just copy and paste the plot to Inkscape. It keeps original size and all shapes are vectorized.

Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574