#69 com->Excel: 'int' object has no attribute 'GetTypeInfo'

closed-duplicate
nobody
com (105)
9
2014-08-22
2003-11-13
bob gailer
No

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'

Discussion

  • bob gailer
    bob gailer
    2003-11-21

    • priority: 5 --> 9
     
  • bob gailer
    bob gailer
    2003-11-21

    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.

     
  • bob gailer
    bob gailer
    2004-04-19

    • summary: com->Excel: 'int' object has no attribute 'GetTypeInfo' --> com->Excel: 'int' object has no attribute 'GetTypeInfo'
     
  • bob gailer
    bob gailer
    2004-04-19

    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.

     
  • Mark Hammond
    Mark Hammond
    2004-04-21

    • status: open --> closed-duplicate
     
  • Mark Hammond
    Mark Hammond
    2004-04-21

    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