Super...Danke.
Auf zur nächsten Runde: Konsolenausgaben siehe komentare...
Code: Alles auswählen
class Excel:
def __init__(self,excelpath,Sheet):
self.excelobj = win32com.client.Dispatch("Excel.Application")
self.excelobj.Visible = True
self.wb = self.excelobj.Workbooks.Open(Filename = excelpath, ReadOnly = True)
self.ws = self.wb.Sheets(Sheet)
def ReturnValue(self,Line,Row):
print type(self.ws.Range(Line+Row)) # <type 'instance'>
print self.ws.__class__.__name__ #CDispatch
print dir(self.ws) # siehe weiter unten
print self.ws._unicode_to_string_ #false
return self.ws.Range(Line+Row)
def close(self):
del excelobj
Mit dem CDispatch kann ich leider nichts anfangen....
Ausgabe von dir(self.ws):
['_ApplyTypes_', '_FlagAsMethod', '_LazyAddAttr_', '_NewEnum', '_Release_', '__AttrToID__', '__LazyMap__', '__call__', '__cmp__', '__doc__', '__getattr__', '__getitem__', '__init__', '__int__', '__len__', '__module__', '__nonzero__', '__repr__', '__setattr__', '__setitem__', '__str__', '_builtMethods_', '_enum_', '_find_dispatch_type_', '_get_good_object_', '_get_good_single_object_', '_lazydata_', '_make_method_', '_mapCachedItems_', '_oleobj_', '_olerepr_', '_print_details_', '_proc_', '_unicode_to_string_', '_username_', '_wrap_dispatch_']
kann ich leider auch nichts damit anfangen - hab auch schon die Hilfe benutzt, aber nichts brauchbares gefunden...
Danke für deine Geduld BlackJack - ich seh schon ich kann (muss) noch viel lernen.