Office 2004 Graphic Filters

M

Mark Perka-MS

In Mac Excel -- you can drag ranges to the desktop to create clippings ...
this may be one way to achieve what you want if I understand that correctly.
Also you can control+click on graphic objects and choose save as to save as
pictures.
 
C

CyberTaz

You might also want to take a look at the utility called Grab that ships
with OS X. It will probably give you even better results if I am
interpreting you correctly.

HTH |:>)
Bob Jones
[MVP] Office:Mac
 
J

Jim

Mark,
In order for the following statement
"blnRet = chtTheChart.Export(Filename:="c:\range.gif", _
FilterName:="gif",
Interactive:=False) "
to work, a graphic filer of the appropriate type must exist.
This statement doesn't execute for me and I can't find anything named
"GIF" in the MS Office location where graphic filters are supposed to
be.
Thanks for the input.
Jim
 
J

Jim

CT,
What I'd like to do is create and save an image in a particular image
format from within a VBA sub.
I can do that in the PNG format, but I don't have the JPEG or GIF
options available to me in excel. I'd like this to me a "hands-off"
process.
I've determined that I can't do a GIF export because I'm missing the
GIF graphic filter in the Office Shared Applications, Graphic Filters
folder.
Thanks,
Jim
 
J

Jim

Bob,
There are some differences, but usually they are minor. I've had
excellent results porting back & forth.
In this case, I can't seem to make this statment (taken from Office for
Mac 2004) to execute:

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

Here's the complete help entry one of the items listed when searching
for "export".

Export Method Example
This example exports chart one as a GIF file.
Charts(1).Export _
FileName:="current_sales.gif", FilterName:="GIF"

Thanks,
Jim
 
C

CyberTaz

Hi Jim -

I believe this is one difference which is more major than minor. Perhaps I
wasn't clear in what I was trying to say. Take a close look at the VBA Help
quote below which precedes the example you cited. I've marked in brackets
what I believe to be key points:
FilterName [Optional Variant]. The language-independent name of the graphic
filter as it appears in the [registry]. FilterName must be specified if FileName
does not include an extension that indicates a recognized image file type.
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.

What I take from this is that the filtername argument is *optional* & in
Windows is needed to call the appropriate filter from the *Registry*, which
OS X does not use. Further, the reference to the Shared Applications folder
is based on Office *X* for the location of the filters, but Office 2004
(IIRC) no longer needs them - the graphics formats used by "Save As"
operations are called, I am assuming, from the OS. Have you tried just
outputting the object as "filename.jpeg/.png/etc. without using the filter
argument? As I said, I'm not a coder, so if there is some syntax required
for a system call of some sort I can't say, but I'm pretty sure the filter
isn't supplied by Office.

Regards |:>)
Bob Jones
[MVP] Office:Mac
 
J

Jim

Bob,

I just tried with the only the filename with .gif as an extention. I
got the same error as before.
I checked my previous version of office for the mac and there were
graphics filters.

Also I've tried selecting the figutre in a chart frame and attempted a
save as. All I saw for file types were those possible for a
spreadsheet. Maybe I don't know how to save/export a spreadsheet Item
correctly.

Thanks for the ideas & interest,

Jim

Hi Jim -

I believe this is one difference which is more major than minor. Perhaps I
wasn't clear in what I was trying to say. Take a close look at the VBA Help
quote below which precedes the example you cited. I've marked in brackets
what I believe to be key points:
FilterName [Optional Variant]. The language-independent name of the graphic
filter as it appears in the [registry]. FilterName must be specified if FileName
does not include an extension that indicates a recognized image file type.
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.

What I take from this is that the filtername argument is *optional* & in
Windows is needed to call the appropriate filter from the *Registry*, which
OS X does not use. Further, the reference to the Shared Applications folder
is based on Office *X* for the location of the filters, but Office 2004
(IIRC) no longer needs them - the graphics formats used by "Save As"
operations are called, I am assuming, from the OS. Have you tried just
outputting the object as "filename.jpeg/.png/etc. without using the filter
argument? As I said, I'm not a coder, so if there is some syntax required
for a system call of some sort I can't say, but I'm pretty sure the filter
isn't supplied by Office.

Regards |:>)
Bob Jones
[MVP] Office:Mac


Bob,
There are some differences, but usually they are minor. I've had
excellent results porting back & forth.
In this case, I can't seem to make this statment (taken from Office for
Mac 2004) to execute:

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

Here's the complete help entry one of the items listed when searching
for "export".

Export Method Example
This example exports chart one as a GIF file.
Charts(1).Export _
FileName:="current_sales.gif", FilterName:="GIF"

Thanks,
Jim
 
C

CyberTaz

When you right(ctrl)-click an object - such as a chart - the contextual menu
provides a "Save as Picture" command. Selecting that command calls a Save:
Microsoft Excel dialog which contains a list of graphic file formats that
includes JPEG, GIF, PNG, PICT, & BMP.

I have successfully used all I have tried even though there is no
corresponding graphics filter - at least I haven't been able to locate any -
other than the EPS & Metafile filters in the Shared Apps folder. Those,
however, are *Import* filters, not Export filters. I've searched the MS site
& not even found a reference to graphics filters for Office 2004.

That suggests to me that there must be some other variation on the Export
Method or a syntax requirement that isn't disclosed in VBA Help. Wouldn't be
the first help topic that wasn't completely up-to-date. OTOH, perhaps the
filters from Office X need to be used with 2004 if they are required by VBA,
but aren't needed for 'manual' graphics output. Doesn't make sense to me
that code can't make the app do what it is programmed to do without relying
on external filters, but...

Like I keep reminding you, though, a programmer I ain't, so what the answer
is I have no idea. I have posted a request in the MVPs' ng for someone with
VBA know-how to have a look at this thread. I'm sure the cavalry will be
arriving before too long :)

Regards |:>)
Bob Jones
[MVP] Office:Mac



Bob,

I just tried with the only the filename with .gif as an extention. I
got the same error as before.
I checked my previous version of office for the mac and there were
graphics filters.

Also I've tried selecting the figutre in a chart frame and attempted a
save as. All I saw for file types were those possible for a
spreadsheet. Maybe I don't know how to save/export a spreadsheet Item
correctly.

Thanks for the ideas & interest,

Jim

Hi Jim -

I believe this is one difference which is more major than minor. Perhaps I
wasn't clear in what I was trying to say. Take a close look at the VBA Help
quote below which precedes the example you cited. I've marked in brackets
what I believe to be key points:
FilterName [Optional Variant]. The language-independent name of the
graphic
filter as it appears in the [registry]. FilterName must be specified if FileName
does not include an extension that indicates a recognized image file type.
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.

What I take from this is that the filtername argument is *optional* & in
Windows is needed to call the appropriate filter from the *Registry*, which
OS X does not use. Further, the reference to the Shared Applications folder
is based on Office *X* for the location of the filters, but Office 2004
(IIRC) no longer needs them - the graphics formats used by "Save As"
operations are called, I am assuming, from the OS. Have you tried just
outputting the object as "filename.jpeg/.png/etc. without using the filter
argument? As I said, I'm not a coder, so if there is some syntax required
for a system call of some sort I can't say, but I'm pretty sure the filter
isn't supplied by Office.

Regards |:>)
Bob Jones
[MVP] Office:Mac


Bob,
There are some differences, but usually they are minor. I've had
excellent results porting back & forth.
In this case, I can't seem to make this statment (taken from Office for
Mac 2004) to execute:

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

Here's the complete help entry one of the items listed when searching
for "export".

Export Method Example
This example exports chart one as a GIF file.
Charts(1).Export _
FileName:="current_sales.gif", FilterName:="GIF"

Thanks,
Jim
---------------------------------------------
CyberTaz wrote:
Hi Jim -

My oversight for not realizing you were trying to do this programmatically.
Even so, you may find Grab a fun toy to play with if you're not already
familiar with it.

I'm not a programmer, but the thread you cited suggests that the calls on
the Mac may be entirely different due to how graphics are handled on the 2
platforms... My reasoning based on the fact that in Mac XL you can simply
ctrl-click an image & save in the formats you indicated, whereas on the PC
you can't, and there is no 'filter' for either format in the Shared
Applications folder.

Sorry I have nothing more to offer, but perhaps someone else is doing some
research & will respond later. If I can find anything more I will post
back.

Good Luck |:>)
Bob Jones
[MVP] Office:Mac



On 6/25/06 9:01 AM, in article
(e-mail address removed), "Jim"

CT,
What I'd like to do is create and save an image in a particular image
format from within a VBA sub.
I can do that in the PNG format, but I don't have the JPEG or GIF
options available to me in excel. I'd like this to me a "hands-off"
process.
I've determined that I can't do a GIF export because I'm missing the
GIF graphic filter in the Office Shared Applications, Graphic Filters
folder.
Thanks,
Jim

CyberTaz wrote:
You might also want to take a look at the utility called Grab that ships
with OS X. It will probably give you even better results if I am
interpreting you correctly.

HTH |:>)
Bob Jones
[MVP] Office:Mac



On 6/15/06 4:40 PM, in article
(e-mail address removed), "Jim"

When I looked for Graphic Filters in the Office:..:Shared
Applications:Graphics Filters folder, I found none. Where can I get
these?
I need them to save jpeg, gif, etc images of spreadsheets parts. See
thread below>

http://groups.google.com/group/microsoft.public.excel.programming/browse
_f
rm
/t
hread/1a843aab1053e786/7b78a8ca061e8355?lnk=st&q=jvbeaupre&rnum=4#7b78a8
ca
06
1e
8355
 
P

Paul Berkowitz

There seems to be no VBA nor AppleScript equivalent to the UI's contextual
"Save As Picture" method, with its 5 graphics formats.

Jim was on the right track; 'Export' _should_ work but it doesn't - it
errors. (Note that when you compile it the named argument 'FileName:="
changes to "Filename:=" with lower-case 'n' - bad news. It comes from a
different method since FileName is not available.) Another clue is that
there is no AppleScript of the Export Method (command) in the Dictionary.
It's not available.

And SaveAs Method also doesn't work on the Chart as such (not surprisingly,
since you can't do it for a chart from the File/Save As menu in the UI.) You
can't specify the FileFormat argument to be a picture either, since the
XlFileFormat enumerations contain no picture formats.

There doesn't seem to be a solution. We can file a bug report - do it for
AppleScript too.

--
Paul Berkowitz
MVP MacOffice
Entourage FAQ Page: <http://www.entourage.mvps.org/faq/index.html>
AppleScripts for Entourage: <http://macscripter.net/scriptbuilders/>

Please "Reply To Newsgroup" to reply to this message. Emails will be
ignored.

PLEASE always state which version of Microsoft Office you are using -
**2004**, X or 2001. It's often impossible to answer your questions
otherwise.

From: CyberTaz <[email protected]>
Newsgroups: microsoft.public.mac.office.excel
Date: Sun, 25 Jun 2006 22:40:59 -0400
Conversation: Office 2004 Graphic Filters
Subject: Re: Office 2004 Graphic Filters

When you right(ctrl)-click an object - such as a chart - the contextual menu
provides a "Save as Picture" command. Selecting that command calls a Save:
Microsoft Excel dialog which contains a list of graphic file formats that
includes JPEG, GIF, PNG, PICT, & BMP.

I have successfully used all I have tried even though there is no
corresponding graphics filter - at least I haven't been able to locate any -
other than the EPS & Metafile filters in the Shared Apps folder. Those,
however, are *Import* filters, not Export filters. I've searched the MS site
& not even found a reference to graphics filters for Office 2004.

That suggests to me that there must be some other variation on the Export
Method or a syntax requirement that isn't disclosed in VBA Help. Wouldn't be
the first help topic that wasn't completely up-to-date. OTOH, perhaps the
filters from Office X need to be used with 2004 if they are required by VBA,
but aren't needed for 'manual' graphics output. Doesn't make sense to me
that code can't make the app do what it is programmed to do without relying
on external filters, but...

Like I keep reminding you, though, a programmer I ain't, so what the answer
is I have no idea. I have posted a request in the MVPs' ng for someone with
VBA know-how to have a look at this thread. I'm sure the cavalry will be
arriving before too long :)

Regards |:>)
Bob Jones
[MVP] Office:Mac



Bob,

I just tried with the only the filename with .gif as an extention. I
got the same error as before.
I checked my previous version of office for the mac and there were
graphics filters.

Also I've tried selecting the figutre in a chart frame and attempted a
save as. All I saw for file types were those possible for a
spreadsheet. Maybe I don't know how to save/export a spreadsheet Item
correctly.

Thanks for the ideas & interest,

Jim

Hi Jim -

I believe this is one difference which is more major than minor. Perhaps I
wasn't clear in what I was trying to say. Take a close look at the VBA Help
quote below which precedes the example you cited. I've marked in brackets
what I believe to be key points:

FilterName [Optional Variant]. The language-independent name of the
graphic
filter as it appears in the [registry]. FilterName must be specified if
FileName
does not include an extension that indicates a recognized image file type.
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.

What I take from this is that the filtername argument is *optional* & in
Windows is needed to call the appropriate filter from the *Registry*, which
OS X does not use. Further, the reference to the Shared Applications folder
is based on Office *X* for the location of the filters, but Office 2004
(IIRC) no longer needs them - the graphics formats used by "Save As"
operations are called, I am assuming, from the OS. Have you tried just
outputting the object as "filename.jpeg/.png/etc. without using the filter
argument? As I said, I'm not a coder, so if there is some syntax required
for a system call of some sort I can't say, but I'm pretty sure the filter
isn't supplied by Office.

Regards |:>)
Bob Jones
[MVP] Office:Mac


On 6/25/06 2:30 PM, in article
(e-mail address removed), "Jim"

Bob,
There are some differences, but usually they are minor. I've had
excellent results porting back & forth.
In this case, I can't seem to make this statment (taken from Office for
Mac 2004) to execute:

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

Here's the complete help entry one of the items listed when searching
for "export".

Export Method Example
This example exports chart one as a GIF file.
Charts(1).Export _
FileName:="current_sales.gif", FilterName:="GIF"

Thanks,
Jim
---------------------------------------------
CyberTaz wrote:
Hi Jim -

My oversight for not realizing you were trying to do this
programmatically.
Even so, you may find Grab a fun toy to play with if you're not already
familiar with it.

I'm not a programmer, but the thread you cited suggests that the calls on
the Mac may be entirely different due to how graphics are handled on the 2
platforms... My reasoning based on the fact that in Mac XL you can simply
ctrl-click an image & save in the formats you indicated, whereas on the PC
you can't, and there is no 'filter' for either format in the Shared
Applications folder.

Sorry I have nothing more to offer, but perhaps someone else is doing some
research & will respond later. If I can find anything more I will post
back.

Good Luck |:>)
Bob Jones
[MVP] Office:Mac



On 6/25/06 9:01 AM, in article
(e-mail address removed), "Jim"

CT,
What I'd like to do is create and save an image in a particular image
format from within a VBA sub.
I can do that in the PNG format, but I don't have the JPEG or GIF
options available to me in excel. I'd like this to me a "hands-off"
process.
I've determined that I can't do a GIF export because I'm missing the
GIF graphic filter in the Office Shared Applications, Graphic Filters
folder.
Thanks,
Jim

CyberTaz wrote:
You might also want to take a look at the utility called Grab that ships
with OS X. It will probably give you even better results if I am
interpreting you correctly.

HTH |:>)
Bob Jones
[MVP] Office:Mac



On 6/15/06 4:40 PM, in article
(e-mail address removed), "Jim"

When I looked for Graphic Filters in the Office:..:Shared
Applications:Graphics Filters folder, I found none. Where can I get
these?
I need them to save jpeg, gif, etc images of spreadsheets parts. See
thread below>
http://groups.google.com/group/microsoft.public.excel.programming/brows>>>>>>>>
ehread/1a843aab1053e786/7b78a8ca061e8355?lnk=st&q=jvbeaupre&rnum=4#7b78a>>>>>>>>
8
 
J

Jim

Paul,
After I read Bob's last message I did find "Save as a Picture", but,
the macro recorder doesn't work. The only thing left would appear to be
a bug report. Anyone know the bug report email?
Jim

PS--Well maybe I can find the "save as a picture" dialog in the VBA
dialog functions.

Paul said:
There seems to be no VBA nor AppleScript equivalent to the UI's contextual
"Save As Picture" method, with its 5 graphics formats.

Jim was on the right track; 'Export' _should_ work but it doesn't - it
errors. (Note that when you compile it the named argument 'FileName:="
changes to "Filename:=" with lower-case 'n' - bad news. It comes from a
different method since FileName is not available.) Another clue is that
there is no AppleScript of the Export Method (command) in the Dictionary.
It's not available.

And SaveAs Method also doesn't work on the Chart as such (not surprisingly,
since you can't do it for a chart from the File/Save As menu in the UI.) You
can't specify the FileFormat argument to be a picture either, since the
XlFileFormat enumerations contain no picture formats.

There doesn't seem to be a solution. We can file a bug report - do it for
AppleScript too.

--
Paul Berkowitz
MVP MacOffice
Entourage FAQ Page: <http://www.entourage.mvps.org/faq/index.html>
AppleScripts for Entourage: <http://macscripter.net/scriptbuilders/>

Please "Reply To Newsgroup" to reply to this message. Emails will be
ignored.

PLEASE always state which version of Microsoft Office you are using -
**2004**, X or 2001. It's often impossible to answer your questions
otherwise.

From: CyberTaz <[email protected]>
Newsgroups: microsoft.public.mac.office.excel
Date: Sun, 25 Jun 2006 22:40:59 -0400
Conversation: Office 2004 Graphic Filters
Subject: Re: Office 2004 Graphic Filters

When you right(ctrl)-click an object - such as a chart - the contextual menu
provides a "Save as Picture" command. Selecting that command calls a Save:
Microsoft Excel dialog which contains a list of graphic file formats that
includes JPEG, GIF, PNG, PICT, & BMP.

I have successfully used all I have tried even though there is no
corresponding graphics filter - at least I haven't been able to locate any -
other than the EPS & Metafile filters in the Shared Apps folder. Those,
however, are *Import* filters, not Export filters. I've searched the MS site
& not even found a reference to graphics filters for Office 2004.

That suggests to me that there must be some other variation on the Export
Method or a syntax requirement that isn't disclosed in VBA Help. Wouldn't be
the first help topic that wasn't completely up-to-date. OTOH, perhaps the
filters from Office X need to be used with 2004 if they are required by VBA,
but aren't needed for 'manual' graphics output. Doesn't make sense to me
that code can't make the app do what it is programmed to do without relying
on external filters, but...

Like I keep reminding you, though, a programmer I ain't, so what the answer
is I have no idea. I have posted a request in the MVPs' ng for someone with
VBA know-how to have a look at this thread. I'm sure the cavalry will be
arriving before too long :)

Regards |:>)
Bob Jones
[MVP] Office:Mac



Bob,

I just tried with the only the filename with .gif as an extention. I
got the same error as before.
I checked my previous version of office for the mac and there were
graphics filters.

Also I've tried selecting the figutre in a chart frame and attempted a
save as. All I saw for file types were those possible for a
spreadsheet. Maybe I don't know how to save/export a spreadsheet Item
correctly.

Thanks for the ideas & interest,

Jim


CyberTaz wrote:
Hi Jim -

I believe this is one difference which is more major than minor. Perhaps I
wasn't clear in what I was trying to say. Take a close look at the VBA Help
quote below which precedes the example you cited. I've marked in brackets
what I believe to be key points:

FilterName [Optional Variant]. The language-independent name of the
graphic
filter as it appears in the [registry]. FilterName must be specified if
FileName
does not include an extension that indicates a recognized image file type.
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.

What I take from this is that the filtername argument is *optional* & in
Windows is needed to call the appropriate filter from the *Registry*, which
OS X does not use. Further, the reference to the Shared Applications folder
is based on Office *X* for the location of the filters, but Office 2004
(IIRC) no longer needs them - the graphics formats used by "Save As"
operations are called, I am assuming, from the OS. Have you tried just
outputting the object as "filename.jpeg/.png/etc. without using the filter
argument? As I said, I'm not a coder, so if there is some syntax required
for a system call of some sort I can't say, but I'm pretty sure the filter
isn't supplied by Office.

Regards |:>)
Bob Jones
[MVP] Office:Mac


On 6/25/06 2:30 PM, in article
(e-mail address removed), "Jim"

Bob,
There are some differences, but usually they are minor. I've had
excellent results porting back & forth.
In this case, I can't seem to make this statment (taken from Office for
Mac 2004) to execute:

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

Here's the complete help entry one of the items listed when searching
for "export".

Export Method Example
This example exports chart one as a GIF file.
Charts(1).Export _
FileName:="current_sales.gif", FilterName:="GIF"

Thanks,
Jim
---------------------------------------------
CyberTaz wrote:
Hi Jim -

My oversight for not realizing you were trying to do this
programmatically.
Even so, you may find Grab a fun toy to play with if you're not already
familiar with it.

I'm not a programmer, but the thread you cited suggests that the calls on
the Mac may be entirely different due to how graphics are handled on the 2
platforms... My reasoning based on the fact that in Mac XL you can simply
ctrl-click an image & save in the formats you indicated, whereas on the PC
you can't, and there is no 'filter' for either format in the Shared
Applications folder.

Sorry I have nothing more to offer, but perhaps someone else is doing some
research & will respond later. If I can find anything more I will post
back.

Good Luck |:>)
Bob Jones
[MVP] Office:Mac



On 6/25/06 9:01 AM, in article
(e-mail address removed), "Jim"

CT,
What I'd like to do is create and save an image in a particular image
format from within a VBA sub.
I can do that in the PNG format, but I don't have the JPEG or GIF
options available to me in excel. I'd like this to me a "hands-off"
process.
I've determined that I can't do a GIF export because I'm missing the
GIF graphic filter in the Office Shared Applications, Graphic Filters
folder.
Thanks,
Jim

CyberTaz wrote:
You might also want to take a look at the utility called Grab that ships
with OS X. It will probably give you even better results if I am
interpreting you correctly.

HTH |:>)
Bob Jones
[MVP] Office:Mac



On 6/15/06 4:40 PM, in article
(e-mail address removed), "Jim"

When I looked for Graphic Filters in the Office:..:Shared
Applications:Graphics Filters folder, I found none. Where can I get
these?
I need them to save jpeg, gif, etc images of spreadsheets parts. See
thread below>
http://groups.google.com/group/microsoft.public.excel.programming/brows>>>>>>>>
ehread/1a843aab1053e786/7b78a8ca061e8355?lnk=st&q=jvbeaupre&rnum=4#7b78a>>>>>>>>
8
ca
06
1e
8355
 
J

Jim Gordon

Hi Jim and others,

There are two Excel VBA export commands.

One of them is supposed to work with chart objects. The secret to it is
that the chart object must be a chart sheet, not a chart on a worksheet.

The example given in help for this is:
This example exports chart one as a GIF file.
Charts(1).Export FileName:="current_sales.gif", FilterName:="GIF"

The above code works in Excel 2001. It does not work in XL 2004. I don't
know about v.X. It is supposed to work, but it does not so that is a bug.

The other Excel export method involves pictures on userforms, which have
always been problematic.

If you want to save a picture of graph there are ways. For example you
can get the graph into PowerPoint and use PowerPoint's export method.

Or you could copy the graph to the clipboard as a picture and use a
different application to save the picture.

-Jim Gordon
Mac MVP


Paul,
After I read Bob's last message I did find "Save as a Picture", but,
the macro recorder doesn't work. The only thing left would appear to be
a bug report. Anyone know the bug report email?
Jim

PS--Well maybe I can find the "save as a picture" dialog in the VBA
dialog functions.

Paul said:
There seems to be no VBA nor AppleScript equivalent to the UI's contextual
"Save As Picture" method, with its 5 graphics formats.

Jim was on the right track; 'Export' _should_ work but it doesn't - it
errors. (Note that when you compile it the named argument 'FileName:="
changes to "Filename:=" with lower-case 'n' - bad news. It comes from a
different method since FileName is not available.) Another clue is that
there is no AppleScript of the Export Method (command) in the Dictionary.
It's not available.

And SaveAs Method also doesn't work on the Chart as such (not surprisingly,
since you can't do it for a chart from the File/Save As menu in the UI.) You
can't specify the FileFormat argument to be a picture either, since the
XlFileFormat enumerations contain no picture formats.

There doesn't seem to be a solution. We can file a bug report - do it for
AppleScript too.

--
Paul Berkowitz
MVP MacOffice
Entourage FAQ Page: <http://www.entourage.mvps.org/faq/index.html>
AppleScripts for Entourage: <http://macscripter.net/scriptbuilders/>

Please "Reply To Newsgroup" to reply to this message. Emails will be
ignored.

PLEASE always state which version of Microsoft Office you are using -
**2004**, X or 2001. It's often impossible to answer your questions
otherwise.

From: CyberTaz <[email protected]>
Newsgroups: microsoft.public.mac.office.excel
Date: Sun, 25 Jun 2006 22:40:59 -0400
Conversation: Office 2004 Graphic Filters
Subject: Re: Office 2004 Graphic Filters

When you right(ctrl)-click an object - such as a chart - the contextual menu
provides a "Save as Picture" command. Selecting that command calls a Save:
Microsoft Excel dialog which contains a list of graphic file formats that
includes JPEG, GIF, PNG, PICT, & BMP.

I have successfully used all I have tried even though there is no
corresponding graphics filter - at least I haven't been able to locate any -
other than the EPS & Metafile filters in the Shared Apps folder. Those,
however, are *Import* filters, not Export filters. I've searched the MS site
& not even found a reference to graphics filters for Office 2004.

That suggests to me that there must be some other variation on the Export
Method or a syntax requirement that isn't disclosed in VBA Help. Wouldn't be
the first help topic that wasn't completely up-to-date. OTOH, perhaps the
filters from Office X need to be used with 2004 if they are required by VBA,
but aren't needed for 'manual' graphics output. Doesn't make sense to me
that code can't make the app do what it is programmed to do without relying
on external filters, but...

Like I keep reminding you, though, a programmer I ain't, so what the answer
is I have no idea. I have posted a request in the MVPs' ng for someone with
VBA know-how to have a look at this thread. I'm sure the cavalry will be
arriving before too long :)

Regards |:>)
Bob Jones
[MVP] Office:Mac



On 6/25/06 8:49 PM, in article
(e-mail address removed), "Jim"

Bob,

I just tried with the only the filename with .gif as an extention. I
got the same error as before.
I checked my previous version of office for the mac and there were
graphics filters.

Also I've tried selecting the figutre in a chart frame and attempted a
save as. All I saw for file types were those possible for a
spreadsheet. Maybe I don't know how to save/export a spreadsheet Item
correctly.

Thanks for the ideas & interest,

Jim


CyberTaz wrote:
Hi Jim -

I believe this is one difference which is more major than minor. Perhaps I
wasn't clear in what I was trying to say. Take a close look at the VBA Help
quote below which precedes the example you cited. I've marked in brackets
what I believe to be key points:

FilterName [Optional Variant]. The language-independent name of the
graphic
filter as it appears in the [registry]. FilterName must be specified if
FileName
does not include an extension that indicates a recognized image file type.
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.
What I take from this is that the filtername argument is *optional* & in
Windows is needed to call the appropriate filter from the *Registry*, which
OS X does not use. Further, the reference to the Shared Applications folder
is based on Office *X* for the location of the filters, but Office 2004
(IIRC) no longer needs them - the graphics formats used by "Save As"
operations are called, I am assuming, from the OS. Have you tried just
outputting the object as "filename.jpeg/.png/etc. without using the filter
argument? As I said, I'm not a coder, so if there is some syntax required
for a system call of some sort I can't say, but I'm pretty sure the filter
isn't supplied by Office.

Regards |:>)
Bob Jones
[MVP] Office:Mac


On 6/25/06 2:30 PM, in article
(e-mail address removed), "Jim"

Bob,
There are some differences, but usually they are minor. I've had
excellent results porting back & forth.
In this case, I can't seem to make this statment (taken from Office for
Mac 2004) to execute:

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

Here's the complete help entry one of the items listed when searching
for "export".

Export Method Example
This example exports chart one as a GIF file.
Charts(1).Export _
FileName:="current_sales.gif", FilterName:="GIF"

Thanks,
Jim
---------------------------------------------
CyberTaz wrote:
Hi Jim -

My oversight for not realizing you were trying to do this
programmatically.
Even so, you may find Grab a fun toy to play with if you're not already
familiar with it.

I'm not a programmer, but the thread you cited suggests that the calls on
the Mac may be entirely different due to how graphics are handled on the 2
platforms... My reasoning based on the fact that in Mac XL you can simply
ctrl-click an image & save in the formats you indicated, whereas on the PC
you can't, and there is no 'filter' for either format in the Shared
Applications folder.

Sorry I have nothing more to offer, but perhaps someone else is doing some
research & will respond later. If I can find anything more I will post
back.

Good Luck |:>)
Bob Jones
[MVP] Office:Mac



On 6/25/06 9:01 AM, in article
(e-mail address removed), "Jim"

CT,
What I'd like to do is create and save an image in a particular image
format from within a VBA sub.
I can do that in the PNG format, but I don't have the JPEG or GIF
options available to me in excel. I'd like this to me a "hands-off"
process.
I've determined that I can't do a GIF export because I'm missing the
GIF graphic filter in the Office Shared Applications, Graphic Filters
folder.
Thanks,
Jim

CyberTaz wrote:
You might also want to take a look at the utility called Grab that ships
with OS X. It will probably give you even better results if I am
interpreting you correctly.

HTH |:>)
Bob Jones
[MVP] Office:Mac



On 6/15/06 4:40 PM, in article
(e-mail address removed), "Jim"

When I looked for Graphic Filters in the Office:..:Shared
Applications:Graphics Filters folder, I found none. Where can I get
these?
I need them to save jpeg, gif, etc images of spreadsheets parts. See
thread below>

http://groups.google.com/group/microsoft.public.excel.programming/brows>>>>>>>>
e
hread/1a843aab1053e786/7b78a8ca061e8355?lnk=st&q=jvbeaupre&rnum=4#7b78a>>>>>>>>
8
ca
06
1e
8355
 
J

Jim Gordon

Read the SaveAs topic in help and you'll find you can save in format
xlhtml and use the Publish argument. That should produce a picture for you.

-Jim Gordon
Mac MVP
 

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