Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #66161 > unrolled thread

AttributeError: '<win32com.gen_py.Microsoft Excel 14.0 Object Library.Shape instance at 0x70837752>' object has no attribute 'SeriesCollection'

Started byJaydeep Patil <patil.jay2009@gmail.com>
First post2014-02-13 03:04 -0800
Last post2014-02-13 15:08 +0000
Articles 5 — 4 participants

Back to article view | Back to comp.lang.python


Contents

  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

#66161 — AttributeError: '<win32com.gen_py.Microsoft Excel 14.0 Object Library.Shape instance at 0x70837752>' object has no attribute 'SeriesCollection'

FromJaydeep Patil <patil.jay2009@gmail.com>
Date2014-02-13 03:04 -0800
SubjectAttributeError: '<win32com.gen_py.Microsoft Excel 14.0 Object Library.Shape instance at 0x70837752>' object has no attribute 'SeriesCollection'
Message-ID<942ed7d6-aec9-4bb5-9b88-60ce62b3ff2e@googlegroups.com>
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

[toc] | [next] | [standalone]


#66162

FromBen Finney <ben+python@benfinney.id.au>
Date2014-02-13 22:11 +1100
Message-ID<mailman.6828.1392290105.18130.python-list@python.org>
In reply to#66161
Jaydeep Patil <patil.jay2009@gmail.com> writes:

> I have created chart object. But unable to add series into chart.

Your code isn't self-contained (we are not able to run it as you
presented it).

Are you relying on some specific third-party library? If so, you need to
be explicit. You may also get better response if you ask for help on the
specific discussion forums for that library.

-- 
 \       “My classmates would copulate with anything that moved, but I |
  `\               never saw any reason to limit myself.” —Emo Philips |
_o__)                                                                  |
Ben Finney

[toc] | [prev] | [next] | [standalone]


#66169

FromJaydeep Patil <patil.jay2009@gmail.com>
Date2014-02-13 03:58 -0800
Message-ID<ee35528c-968e-48f8-b360-922f4820f6b5@googlegroups.com>
In reply to#66162
On Thursday, 13 February 2014 16:41:48 UTC+5:30, Ben Finney  wrote:
> Jaydeep Patil <patil.jay2009@gmail.com> writes:
> 
> 
> 
> > I have created chart object. But unable to add series into chart.
> 
> 
> 
> Your code isn't self-contained (we are not able to run it as you
> 
> presented it).
> 
> 
> 
> Are you relying on some specific third-party library? If so, you need to
> 
> be explicit. You may also get better response if you ask for help on the
> 
> specific discussion forums for that library.
> 
> 
> 
> -- 
> 
>  \       "My classmates would copulate with anything that moved, but I |
> 
>   `\               never saw any reason to limit myself." --Emo Philips |
> 
> _o__)                                                                  |
> 
> Ben Finney

Hi...
Just consider that you have chart object & you need to add data series for that chart. How you can add this?

Let me know.

I try to add data series using below command. But it gives error.

Command:
chartObj.SeriesCollection().NewSeries() 


Error:
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
Jay

[toc] | [prev] | [next] | [standalone]


#66173

FromTim Golden <mail@timgolden.me.uk>
Date2014-02-13 12:13 +0000
Message-ID<mailman.6837.1392293583.18130.python-list@python.org>
In reply to#66169
On 13/02/2014 11:58, Jaydeep Patil wrote:
> Just consider that you have chart object & you need to add data series for that chart. How you can add this?

Jaydeep: you're writing to a general Python list. Few of the people here
run on Windows; fewer still will use Python to automate Excel via COM; a
tiny number (possibly zero) will have experience of generating Charts in
Excel.


It's not that people are unwilling to help, but you have to meet us
halfway: write a few lines of code which take us to the point you're at
that we can run with *just* Python and the pywin32 libraries. Don't call
a function you've defined somewhere else because we can't see the function.

Something like this:

import win32com.client

xl = win32com.client.gencache.EnsureDispatch("Excel.Application")
wb = xl.Workbooks.Add()

#
# Something here to create a chart so we can help you out
#


TJG

[toc] | [prev] | [next] | [standalone]


#66182

FromStefan Schukat <SSchukat@dspace.de>
Date2014-02-13 15:08 +0000
Message-ID<mailman.6842.1392304156.18130.python-list@python.org>
In reply to#66161
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

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web