Hello, I am trying to get this com server to work in VBA. I can register and deregister the server but I can not call it from vba. Any suggestions? I am using windows 10 and office 365 with python3.7.
thanks! --Ben # SimpleCOMServer.py - A sample COM server - almost as small as they come! # # We simply expose a single method in a Python COM object. class PythonUtilities: _public_methods_ = ['SplitString'] _reg_progid_ = "PythonDemos.Utilities" # NEVER copy the following ID # Use "print(pythoncom.CreateGuid())" to make a new one. _reg_clsid_ = "{7D2089C4-CD6A-44BD-A6DC-CA3B3A8A8712}" def SplitString(self, val, item=None): import string if item: item = str(item) return string.split(str(val), item) # Add code so that when this script is run by # Python.exe, it self-registers. if __name__ == '__main__': print("Registering COM server...") import win32com.server.register win32com.server.register.UseCommandLine(PythonUtilities)
_______________________________________________ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32