I'm attempting to insert a list of lists into excel (such that each inner list represents a row, each is of the same length) with the following call :
#Assume ws is correctly initialized to an excel worksheet object
ws.Range(ws.Cells(1,1),ws.Cells(len(myList),len(myList[0]))).value = myList
myList lists contain strings and numpy floats and ints. I get the following error when I attempt to execute the call above:
Traceback (most recent call last):
File "<interactive input>", line 1, in <module>
File "C:\Python32\lib\site-packages\win32com\client\dynamic.py", line 570, in __setattr__
self._oleobj_.Invoke(entry.dispid, 0, invoke_type, 0, value)
MemoryError: CreatingSafeArray
what is causing this win32com.client MemoryError
? Thanks!
I determined the problem was with the numpy values:
My solution was to simply convert all values in my list to string before inserting, guaranteeing no data types will give me problems.