Bugs item #841605, was opened at 2003-11-14 05:24
Message generated for change (Comment added) made by mhammond
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=551954&aid=841605&group_id=78018
Category: com
Group: None
>Status: Closed
>Resolution: Duplicate
Priority: 9
Submitted By: bob gailer (ramrom)
Assigned to: Nobody/Anonymous (nobody)
Summary: com->Excel: 'int' object has no attribute 'GetTypeInfo'
Initial Comment:
win32all Version 154
------------ CODE ---------------
import win32com.client
ex =
win32com.client.Dispatch("excel.application");ex.Visible
= 1
wb = ex.Workbooks.Open('i:\samis\data\graph_base.xls')
sheets = ex.Worksheets.Count
ex.Worksheets(1).Copy(None, ex.Worksheets(1))
wk2 = ex.Worksheets(sheets + 1)
co = wk2.ChartObjects(1)
ch = co.Chart
ch.ChartType = 4 # xlLine
series_range = ex.Range("C25:D27")
ch.SeriesCollection().Add(series_range, 2)
------------ ERROR ---------------
File "i:\samis\python\super_out.py", line 11
ch.SeriesCollection().Add(series_range, 2)
File "<COMObject SeriesCollection>", line 3, in Add
File
"C:\Python22\lib\site-packages\win32com\client\__init__.py",
line 93, in Dispatch
return __WrapDispatch(dispatch, userName,
resultCLSID, typeinfo, UnicodeToString, clsctx)
File
"C:\Python22\lib\site-packages\win32com\client\__init__.py",
line 41, in __WrapDispatch
return dynamic.Dispatch(dispatch, userName,
WrapperClass, typeinfo,
UnicodeToString=UnicodeToString,clsctx=clsctx)
File
"C:\Python22\lib\site-packages\win32com\client\dynamic.py",
line 90, in Dispatch
typeinfo = IDispatch.GetTypeInfo()
AttributeError: 'int' object has no attribute 'GetTypeInfo'
----------------------------------------------------------------------
>Comment By: Mark Hammond (mhammond)
Date: 2004-04-21 22:46
Message:
Logged In: YES
user_id=14198
As discussed on the win32 list, I'm really tempted to call
this an Excel bug. At the very least, I'm going to close
this bug, and track it in the other. A work around should
be to replace this line:
ch.SeriesCollection().Add(series_range, 2)
with:
sc = ch.SeriesCollection()
sc_hack = win32com.client.dynamic.DumbDispatch(sc)
sc_hack.Add(series_range, 2)
and adding 'import win32com.client.dynamic' somewhere,
should work around the problem by avoiding the typeinfo.
Please follow up in bug 938098:
http://sourceforge.net/tracker/index.php?func=detail&aid=938098&group_id=78018&atid=551954
----------------------------------------------------------------------
Comment By: bob gailer (ramrom)
Date: 2004-04-20 05:27
Message:
Logged In: YES
user_id=587593
I have researched this more. I have posted a new bug 938098
with the new research. I am posting a new bug because I have
gone as far as I can and really need help, as my clients are
waiting to use the program.
----------------------------------------------------------------------
Comment By: bob gailer (ramrom)
Date: 2003-11-22 07:54
Message:
Logged In: YES
user_id=587593
I really need help with this one, as I cannot serve my
client's needs until it is fixed.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=551954&aid=841605&group_id=78018
|