Graphic Export

User avatar
Stefan_Sand
4StarLounger
Posts: 412
Joined: 29 Mar 2010, 11:50
Location: Vienna, Austria

Graphic Export

Post by Stefan_Sand »

Hello,

I have a nice Macro (ShowChartsForm-> Export Functions in the Form) , where i can export all or selected charts of a workbook via Listbox Form into .jpg or .png format.
Is there an opportunity to add shapes and maybe pictures/images as well into it? Once, i guess, the famous Excel MVP Andy Pope in GB had a similar tool, but i don´t know , if i am right.

So, has anyone an idea, how to adopt the macro to get shapes and pictures for selection and export into it?

thanks in advance,
Stef
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78237
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Graphic Export

Post by HansV »

Andy Pope's add-in is still available - there is a version for Excel 2007: Graphics Exporter. But I haven't tested it to see if it works in recent versions.

In the attached version, I have added a userform named ShapeForm and a macro ShowShapeForm that opens this userform.

Test Exporter V2a.xlsm
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans

User avatar
Stefan_Sand
4StarLounger
Posts: 412
Joined: 29 Mar 2010, 11:50
Location: Vienna, Austria

Re: Graphic Export

Post by Stefan_Sand »

this is absolute marvelous, Hans!!!!

THANK YOU.
Stef

User avatar
Stefan_Sand
4StarLounger
Posts: 412
Joined: 29 Mar 2010, 11:50
Location: Vienna, Austria

Re: Graphic Export

Post by Stefan_Sand »

Hello,

after the export tool works like a charm, i tried to add an export of shapes as an .wmf file, but it did not work, as i tried to expand the form with a button for wmf format and code lines:
If png = True Then
ImageType = ".png"
Else
ImageType = ".jpg"
End If

Do i have to add anything else as between ImageType = ".png" change to elseif ImageType= ".wmf" to get it work?

User avatar
HansV
Administrator
Posts: 78237
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Graphic Export

Post by HansV »

The Export method of the Chart object does not support vector graphics formats such as .wmf. The available formats are .jpg, .png, .gif and .bmp.
Best wishes,
Hans