Re: [python-win32] chapter 5 : implementing com objects with python

2019-03-26 Thread Tim Roberts

Benjamin McNeill wrote:


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.


Remember that the bit-size must match.  I don't actually know whether 
Office 365 is a 32-bit app or a 64-bit app, but your version of Python 
must match.


--
Tim Roberts, t...@probo.com
Providenza & Boekelheide, Inc.




smime.p7s
Description: S/MIME Cryptographic Signature
___
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32


[python-win32] chapter 5 : implementing com objects with python

2019-03-26 Thread Benjamin McNeill
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