Exporting Chart from Excel using COM Objects

dzmuk

New Member
Hi,

I'm attempting to export and chart generated in MS Excel 2003 as an image. (Chart created using Progress 9.1D 4gl) So far the options which I have explored are the Export option, but I can't find any reference within the Progress COM object viewer, so I guess that Progress doesn't support this option. The second option is the CopyPicture Method.

The COM object viewer claims the syntax is:
[ <anytype>-Var = ] <com-handle>: CopyPicture (
<anytype>-Appearance,
<anytype>-Format,
<anytype>-Size ).

The line of code I'm using is:
vchChart:CopyPicture(1,-4147,1).

Where param 1 is xlScreen, Param 2 is xlPicture and Param 3 is xlScreen

However when running this I receive the following error:
Error occurred while accessing component property/method: CopyPicture. Error code 0x800a01a8.

If I remove any of the parmeters, Progress complains that I've passed less than 3 parameters.

Can any one help?
 
In Excel 97/2000 you could export the spreadsheet as an HTML File. This would convert the graphs into GIFs which were numbered according to the Excel Worksheet Name and the chart number. So, Book1.xls would create book101.gif, book102.gif and so on.

I've just tried it (use Save-As and choose Web Page) and Excel 2000 saved chart1.xls as chart1.htm and put image001.gif in a sub-folder chart1_files.

That's worth trying as you can copy the excel spreadsheet to a dummy one, export the dummy one, capture any images produced and delete all associated files/folders.
 
Back
Top