Python program fragment. Assumes excel dispatched as a
COM object, with a worksheet with a chart:
sc = chart.SeriesCollection()
sc.Add(series_range, seriesAddDirection)
The last line causes an error. Here's the method code
generated for Add by the dispatch module:
def Add(self, Source=pythoncom.Missing, Rowcol=2,
SeriesLabels=pythoncom.Missing,
CategoryLabels=pythoncom.Missing,
Replace=pythoncom.Missing):
ret = self._oleobj_.InvokeTypes(181, LCID, 1,
(9, 0), ((12, 1), (3, 49), (12, 17), (12, 17), (12,
17)),Source, Rowcol, SeriesLabels, CategoryLabels, Replace)
if ret is not None:
ret = Dispatch(ret, 'Add',
'{0002086B-0000-0000-C000-000000000046}',
UnicodeToString=0)
return ret
The call to InvokeTypes returns integer 1 rather than a
PyIDispatch object.
Originally reported under Bug 841605. Creating new bug
since I have researched this in much more detail than
before.
This is as far as I can go without help. I have clients
waiting to use my program as soon as we can fix it.
Logged In: YES
user_id=14198
Noting the dupe is [ 841605 ] com->Excel: 'int' object has
no attribute 'GetTypeInfo'.
I'm afraid this is going in the "excel bug" category, unless
further information comes along.