export graph as a picture file

  • Thread starter Thread starter robert_woodie
  • Start date Start date
R

robert_woodie

i would like to save a graph in excel as a bitmap or similar,
preferbally through Visual basic code.

Ne ideas??

Cheers
Robert
 
Hi Robert
one way to save the file as GIF
Sub SaveAsGIF ()
Fname = ThisWorkbook.Path & "\" & ActiveChart.Name & ".gif"
ActiveChart.Export FileName:=Fname, FilterName:="GIF"
End Sub

Change the FilterName according to your needs

HTH
Frank
 
this code works fine. Does it support any other file formats......one
im interested in:.bmp.png.xpm.jpg

thanks
Rober
 
Hi Robert
have alook at the helpfile. Should support all registered filternames.
so changing GIF to JPG should work (depending on your installation)

Frank
 
Robert -

For sure it supports GIF and JPG. On my computer it also does PNG. I
don't know about BMP (which is too large) or TIF, since GIF and PNG are
fine enough for what I do. Don't use JPG, because it will make the text
labels and sharp color transitions look awful.

- Jon
 
Back
Top