Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to copy an Excel Chart and save it as JPG/GIf
Message
 
To
02/06/2003 19:55:58
Peter Wagner
Point Informática Ltda.
Limeira, Brazil
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00795319
Message ID:
00795488
Views:
27
Peter, if Export method will not work to your expectation, I can only help you with a procedure that saves Clipboard data to *.emf file. Unfortunately I have no routines available for converting EMF data to JPEG or GIF.

Check Export method description from Excel VBA Help.

* * *
Export Method
Exports the chart in a graphic format.
expression.Export(FileName, FilterName, Interactive)
expression
Required.
An expression that returns a Chart object.

FileName
Required String.
The name of the exported file.

FilterName
Optional Variant.
The language-independent name of the graphic filter as it appears in the registry.

Interactive
Optional Variant.
True to display the dialog box that contains the filter-specific options. If this argument is False, Microsoft Excel uses the default values for the filter. The default value is False.

Example
This example exports chart one as a GIF file.
Worksheets("Sheet1").ChartObjects(1) _
.Chart.Export _
    FileName:="current_sales.gif", FilterName:="GIF"
* * *
I guess you can suppress that dialog by setting Interactive to False. And I do believe that FileName parameter can be a full path.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform