I am trying to use Excel as the front end for some python code.
I get an error (below) when trying to use a python code including numpy. If I don't import numpy I do not get the error. Is win32 somehow incompatible with numpy? I would appreciate any information regarding this issue.
Minimal example:
I get a run-time error ' -21474677259(800 04005)':
Unexpected Python Error: Traceback (most recent call last):
File "C:\appl\python 26\lib\site-packages\win32c om\server\polic y.py",
line 136 in CreateInstance
return retObj._CreateI nstance_(clsid, reqIID)
File "C:\appl\python 26\lib\site-packages\win32c om\server\polic y.py",
line 194, in _CreateInstance _
mvob = call func(classSpec)
I get an error (below) when trying to use a python code including numpy. If I don't import numpy I do not get the error. Is win32 somehow incompatible with numpy? I would appreciate any information regarding this issue.
Minimal example:
Code:
import win32com.server.register
import pythoncom
from numpy import mean
class TimeSeriesManipulation:
_public_methods_ = [ 'SplitString']
_reg_progid_ = "PythonUtils.NumpyError"
_reg_clsid_ = "{08A4D1F8-0185-4692-BE40-4AD081DB90B1}"
def SplitString(self, val, item=None):
from string import split
if item != None: item = str(item)
return split(str(val), item)
if __name__=='__main__':
print "Registering COM server..."
import win32com.server.register
win32com.server.register.UseCommandLine(TimeSeriesManipulation)
Code:
Sub tt()
Set PythonUtils = CreateObject("PythonUtils.NumpyError")
response = PythonUtils.SplitString("Hello from VB")
For Each Item In response
MsgBox Item
Next
End Sub
Unexpected Python Error: Traceback (most recent call last):
File "C:\appl\python 26\lib\site-packages\win32c om\server\polic y.py",
line 136 in CreateInstance
return retObj._CreateI nstance_(clsid, reqIID)
File "C:\appl\python 26\lib\site-packages\win32c om\server\polic y.py",
line 194, in _CreateInstance _
mvob = call func(classSpec)
Comment