Creating Charts in Excel with pyExcelerator.ExcelMagic

implicate_order dwai.lahiri at gmail.com
Fri Aug 18 10:25:12 EDT 2006


Gentlemen,

Thanks for your responses. I also found some additional threads on this
newsgroup that gave me insight into how to use the MS Excel com objects
(or whatever they are called)...

So I used this:

xl = win32com.client.Dispatch("Excel.Application")
wb = xl.Workbooks.Open(outfile01)

prodws = wb.Worksheets(1)
wc_prod = wb.Charts.Add()
wc_prod.ChartWizard(Source=prodws.Range("b1", "g30"), Gallery=11,
Format=5, CategoryLabels=3, SeriesLabels=3, PlotBy=None, Title="Prod" )

Does a pretty decent job of creating charts (we can change the chart
type by changing the Gallery and Format values)

So I use pyExcelerator to generate the workbook with various worksheets
and then use win32com.client  to generate the charts.




More information about the Python-list mailing list