[python-win32] Excel and Graphing

Greg Landrum greg.landrum at gmail.com
Thu May 5 16:15:39 CEST 2005


On 5/5/05, eric.powell at srs.gov <eric.powell at srs.gov> wrote:
>  
> I am close to finishing a project using Excel objects in python to generate
> a series of graphs. 
> However.... 
>  
> I can't get the series to add to the chart properly. 
>  
> I have an Excel chart with no series on it, so I am trying to add new series
> using the Chart.SeriesCollection.NewSeries call, but get
> the following error message: 
>  
> Traceback (most recent call last): 
>   File
> "O:\gis\projects\Reactors\Code\Python_Scripts\CMP_PITS_Chart_Tool\chart_tool.py",
> line 133, in ? 
>     create_series(filename, graph, series, scell, data, scount) 
>   File
> "O:\gis\projects\Reactors\Code\Python_Scripts\CMP_PITS_Chart_Tool\chart_tool.py",
> line 70, in create_series 
>     se = chart.SeriesCollection.NewSeries 
> AttributeError: 'function' object has no attribute 'NewSeries' 

The error message is telling you that chart.SeriesCollection is a
method, not an attribute (this is reinforced by the Excel Visual Basic
reference).  So you probably need to do:
se = chart.SeriesCollection().NewSeries()

-greg


More information about the Python-win32 mailing list