Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 162
Default Export Pie Graph Chart as Image

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!

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6,582
Default Export Pie Graph Chart as Image

Fname = ThisWorkbook.Path & "\" & ActiveChart.Name & ".gif"

Is the active chart a chart sheet? If not this line will fail with the
reported message.

A problem I came across recently was that, by installing the Office 2007
Beta on a machine with Office 2003 installed, the graphics filters for
Office 2007 were written over those for Office 2003, causing exports to most
file types to fail. Uninstalling 2007, deleting the file filters (from
C:\Program Files\Common\Microsoft Shared\), and reinstalling from the Office
2003 CD, fixed this problem.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______



wrote in message
oups.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!



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
plot graph from multiple worksheet as embedded chart object on every worksheet [email protected] Charts and Charting in Excel 3 August 24th 06 07:26 PM
plot graph from multiple worksheet as embedded chart object on every worksheet [email protected] Excel Worksheet Functions 2 August 24th 06 05:26 PM
plot graph from multiple worksheet as embedded chart object on every worksheet jeftiong New Users to Excel 0 August 23rd 06 01:50 PM
Creating a stacked column chart with percentage in the graph MQ Charts and Charting in Excel 3 March 14th 06 05:41 AM
can i export a high resolution chart from Excel timmsteiner Excel Discussion (Misc queries) 1 November 13th 05 09:13 AM


All times are GMT +1. The time now is 05:38 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"