Method 'Export' of object '_Chart' failed

C

craigscribner

n the VBA help file, when you search for "export chart", it offers this
example:

Charts(1).Export _
FileName:="current_sales.gif", FilterName:="GIF"

But this throws me an error when I try to run it. I may have a clue
why: It says that

Some examples of valid FilterName values are GIF, JPEG, and PNG.
On the Macintosh, graphics export filters are installed in the
Microsoft Office X:Shared Applications:Graphic Filters folder.

But when I look in that folder, I only have two files:
-EPS Import
-Metafile Import

Do you know where I can get more of these Microsoft file converter
files? Or am I barking up the wrong tree? Can any of you use this code
as-is?
 
J

Jim Gordon MVP

Hi Craig,

It appears you have discovered a bug.

I tried this using several different syntax approaches. Mac XL reports
that charts don't support the Export method when I try it.

I tried in XL 2004 and in XL 2001. Apparantly this command has been
broken a long time.

It appears you will have to come up with an alternative way to save the
graph as a picture.

You can copy the graph as a picture to the clipboard, then switch to
some other application (perhaps via an applescript) and save the picture
from there.

Or you could save the workbook as a web page and grab the picture of the
graph from the saved result.

-Jim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top