Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #66182
| From | Stefan Schukat <SSchukat@dspace.de> |
|---|---|
| Subject | RE: AttributeError: '<win32com.gen_py.Microsoft Excel 14.0 Object Library.Shape instance at 0x70837752>' object has no attribute 'SeriesCollection' |
| Date | 2014-02-13 15:08 +0000 |
| References | <942ed7d6-aec9-4bb5-9b88-60ce62b3ff2e@googlegroups.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.6842.1392304156.18130.python-list@python.org> (permalink) |
Hello,
the "chartObj" is not a Chart object it is a shape see <win32com.gen_py.Microsoft Excel 14.0 Object Library.Shape ...
Hence this object has no SeriesCollection try the Chart Attribute of the shape object.
>>> from win32com.client import Dispatch
>>> Excel = Dispatch("Excel.Application")
>>> WB = Excel.Workbooks.Add()
>>> Shape = WB.Sheets[0].Shapes.AddChart()
>>> Shape.Chart.SeriesCollection
<bound method CDispatch.SeriesCollection of <COMObject <unknown>>>
Regards
Stefan Schukat
-----Original Message-----
From: Python-list [mailto:python-list-bounces+sschukat=dspace.de@python.org] On Behalf Of Jaydeep Patil
Sent: Thursday, February 13, 2014 12:05 PM
To: python-list@python.org
Subject: AttributeError: '<win32com.gen_py.Microsoft Excel 14.0 Object Library.Shape instance at 0x70837752>' object has no attribute 'SeriesCollection'
I have created chart object. But unable to add series into chart.
Look at below collection
Code:
chartObj = addNewChart(newws,-4169,350,600)
>>> print chartObj;
<win32com.gen_py.Microsoft Excel 14.0 Object Library.Shape instance at 0x70837752>
>>> chartObj.SeriesCollection().NewSeries()
Traceback (most recent call last):
File "<pyshell#16>", line 1, in <module>
chartObj.SeriesCollection().NewSeries()
File "C:\Python27\lib\site-packages\win32com\client\__init__.py", line 465, in __getattr__
raise AttributeError("'%s' object has no attribute '%s'" % (repr(self), attr))
AttributeError: '<win32com.gen_py.Microsoft Excel 14.0 Object Library.Shape instance at 0x70837752>' object has no attribute 'SeriesCollection'
>>> se = chartObj.SeriesCollection().NewSeries()
Regards
Jaydeep Patil
--
https://mail.python.org/mailman/listinfo/python-list
Back to comp.lang.python | Previous | Next — Previous in thread | Find similar | Unroll thread
AttributeError: '<win32com.gen_py.Microsoft Excel 14.0 Object Library.Shape instance at 0x70837752>' object has no attribute 'SeriesCollection' Jaydeep Patil <patil.jay2009@gmail.com> - 2014-02-13 03:04 -0800
Re: AttributeError: '<win32com.gen_py.Microsoft Excel 14.0 Object Library.Shape instance at 0x70837752>' object has no attribute 'SeriesCollection' Ben Finney <ben+python@benfinney.id.au> - 2014-02-13 22:11 +1100
Re: AttributeError: '<win32com.gen_py.Microsoft Excel 14.0 Object Library.Shape instance at 0x70837752>' object has no attribute 'SeriesCollection' Jaydeep Patil <patil.jay2009@gmail.com> - 2014-02-13 03:58 -0800
Re: AttributeError: '<win32com.gen_py.Microsoft Excel 14.0 Object Library.Shape instance at 0x70837752>' object has no attribute 'SeriesCollection' Tim Golden <mail@timgolden.me.uk> - 2014-02-13 12:13 +0000
RE: AttributeError: '<win32com.gen_py.Microsoft Excel 14.0 Object Library.Shape instance at 0x70837752>' object has no attribute 'SeriesCollection' Stefan Schukat <SSchukat@dspace.de> - 2014-02-13 15:08 +0000
csiph-web