View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default Export Pie Graph Chart as Image

To save your chart as an image find Stephen Bullen's PastePicture.zip on
this page
http://www.oaltd.co.uk/Excel/Default.htm

It wouldn't be such a problem if I
could have a macro resize the CHART WINDOW to full screen


'Locate' your chart on a Chart sheet
With the chart-sheet, File Page Setup Margins, experiment reducing
margins (reset before printing).
Put the 'Full Screen' menu item on your toolbar which you'll find under -
Customize toolbars Commands View
Do that both with a chart-sheet and worksheet active.

Regards,
Peter T

wrote in message
ups.com...
Hi,

I am trying to export a chart to a local *.gif image and I am getting
all sorts of errors...anyone have any ideas? I have searched the boards

and I keep getting the same error message each time I try to run the
macro...


===========================
Run-time error '91':
Object variable or With block variable not set


Sub SaveChartAsGIF ()
Fname = ThisWorkbook.Path & "\" & ActiveChart.Name & ".gif"
ActiveChart.Export FileName:=Fname, FilterName:="GIF"
End Sub
===========================
Run-time error '1004'
Method 'Export' of object '_Chart' failed


Dim mychart As Chart
Set mychart = ActiveSheet.ChartObjects(1).Chart
mychart.Export Filename:="c:\Mychart.gif", FilterName:="GIF"
============================


I have tried a few other codes on the boards and they all produce one
or the other errors shown above. It wouldn't be such a problem if I
could have a macro resize the CHART WINDOW to full screen but I can't
seem to find that information anywhere...Any help is much appreciated!
Thanks so much!