<p dir="ltr">Are you trying to extract data from the file to make a graph? This is possible.</p>
<div class="gmail_quote">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)" <<a href="mailto:weijwu@cisco.com">weijwu@cisco.com</a>> wrote:<br type="attribution">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-US" link="blue" vlink="purple">
<div>
<p class="MsoNormal">Hi, guys<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I know win32com is working on windows for python, and I’ve question:<u></u><u></u></p>
<p class="MsoNormal">I want to save chart from demo.xlsx as an image. I also found some code as below:<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><b>from win32com.client import Dispatch<u></u><u></u></b></p>
<p class="MsoNormal"><b>xlsApp = Dispatch("Excel.Application") <u></u><u></u></b></p>
<p class="MsoNormal"><b>xlsWB = xlsApp.Workbooks.Open(r'/tmp/test/demo.xlsx') <u></u>
<u></u></b></p>
<p class="MsoNormal"><b>xlsSheet = xlsWB.Sheets("sheet1") <u></u><u></u></b></p>
<p class="MsoNormal"><b>mychart = XlsSheet.Charts(1) #'1' is the index of the chart object in the wb<u></u><u></u></b></p>
<p class="MsoNormal"><b>mychart.Export(Filename=r'/tmp/test/MyExportedChart.png')<u></u><u></u></b></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">is there anyway I can run this code on linux ? <u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">or is there anyway I can save chart from an existing xlsx as an image?<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">It drives me crazy.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Thanks<u></u><u></u></p>
<p class="MsoNormal">Wiley<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
<br>_______________________________________________<br>
python-win32 mailing list<br>
<a href="mailto:python-win32@python.org">python-win32@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-win32" target="_blank">https://mail.python.org/mailman/listinfo/python-win32</a><br>
<br></blockquote></div>