Code: Alles auswählen
import win32com.client
xls = win32com.client.Dispatch("Excel.Application")
xls.Visible = 1
wb = xls.Workbooks.Open("C:\Users\hans\Desktop\test.xls")
"""
for x in range (1,6):
row = wb.Cells(1,x)
print(row)"""
xls.Workbooks.Close()
Jemand ne idee, wie man das beheben kann?in <module>
xls = win32com.client.Dispatch("Excel.Application")
File "C:\Python27\lib\site-packages\win32com\client\__init__.py", line 95, in Dispatch
dispatch, userName = dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx)
File "C:\Python27\lib\site-packages\win32com\client\dynamic.py", line 104, in _GetGoodDispatchAndUserName
return (_GetGoodDispatch(IDispatch, clsctx), userName)
File "C:\Python27\lib\site-packages\win32com\client\dynamic.py", line 84, in _GetGoodDispatch
IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx, pythoncom.IID_IDispatch)
com_error: (-2147221005, 'Ung\xfcltige Klassenzeichenfolge', None, None)