[python-win32] save chart from an existing xlsx as an image

Christian Calderon calderon.christian760 at gmail.com
Fri Jun 20 16:23:33 CEST 2014


Are you trying to extract data from the file to make a graph? This is
possible.
On Jun 20, 2014 1:09 AM, "Weijie Wu -X (weijwu - YI JIN XIN XI FU WU(SU
ZHOU)YOU XIAN GONG SI at Cisco)" <weijwu at cisco.com> wrote:

>  Hi, guys
>
>
>
> I know win32com is working on windows for python, and I’ve question:
>
> I want to save chart from demo.xlsx as an image.  I also found some code
> as below:
>
>
>
> *from win32com.client import Dispatch*
>
> *xlsApp = Dispatch("Excel.Application") *
>
> *xlsWB = xlsApp.Workbooks.Open(r'/tmp/test/demo.xlsx') *
>
> *xlsSheet = xlsWB.Sheets("sheet1") *
>
> *mychart = XlsSheet.Charts(1)  #'1' is the index of the chart object in
> the wb*
>
> *mychart.Export(Filename=r'/tmp/test/MyExportedChart.png')*
>
>
>
>
>
> is there anyway I can run this code on linux ?
>
>
>
> or is there anyway I can save chart from an existing xlsx as an image?
>
>
>
> It drives me crazy.
>
>
>
>
>
> Thanks
>
> Wiley
>
>
>
>
>
> _______________________________________________
> python-win32 mailing list
> python-win32 at python.org
> https://mail.python.org/mailman/listinfo/python-win32
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20140620/0bb7f883/attachment.html>


More information about the python-win32 mailing list