I am supporting this old legacy code that someone else wrote. A user had their computer replaced and the code stopped working. We have some code written in python that we want to access from Excel. We register the python COM like shown below
class COMWSdbAccess: _reg_clsid_ = "{505D2E5B-17EC-426D-AB60-34CDA795B37C}" _reg_desc_ = "WS DB Access COM Server 0.1" _reg_progid_ = "WSdbAccess" _reg_clsctx = pythoncom.CLSCTX_LOCAL_SERVER _public_methods_ = ['wsdbReadAllPrice'] def __init__(self): from wsdb import ws_sec_value_cusip_sel def wsdbReadAllPrice(self, FieldName, Source, PosDt, PrcDt): from wsdb import ws_sec_value_all_sel, wsMarketOpen, wsMarketClose curConn = wsMarketOpen() results = ws_sec_value_all_sel (curConn, str(FieldName), str(Source), str(PosDt), str(PrcDt)) wsMarketClose(curConn) return results if __name__ == '__main__': import win32com.server.register win32com.server.register.UseCommandLine(COMWSdbAccess) Just for the sake of testing, I have these 2 lines of code behind a button in Excel Dim dbServer As Variant Set dbServer = CreateObject("WSdbAccess") And i get the error ""The specified module could not be found" on the second line of the code. It does work from all other computers. The environment is Windows 7 64 bit computers with 32 bit excel and 32 bit python 2.7. I have opened the registry and WSdbAccess does exist. I have compared the registry of the new computer with the old computers and its the same.. PLEASE HELP.
_______________________________________________ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32