Depending on how the object is implemented, you may be able to just change the activation context by adding clsctx=pythoncom.CLSCTX_LOCAL_SERVER to the args passed to Dispatch. If that doesn't work, then try CLSCTX_ACTIVATE_32_BIT_SERVER (0x40000) for the clsctx. If neither of those work, you still may be able to create an out of process proxy for the application using Control Panel->Administrative Tools->Component Services.
Answer from Roger Upole on Stack OverflowDepending on how the object is implemented, you may be able to just change the activation context by adding clsctx=pythoncom.CLSCTX_LOCAL_SERVER to the args passed to Dispatch. If that doesn't work, then try CLSCTX_ACTIVATE_32_BIT_SERVER (0x40000) for the clsctx. If neither of those work, you still may be able to create an out of process proxy for the application using Control Panel->Administrative Tools->Component Services.
try this. i not sure in this solution
C:\Windows\SysWOW64>.\msiexec.exe /i 'path of application'
addition information is here
java - Javax.comm API on 64-bit Windows - Stack Overflow
'win32com.server.register.UseCommandLine(class)' InprocServer32 bug with office 64bit
"win32com.client.gencache.EnsureDispatch" doesn't work on office 64bit
Encounter com_error when use win32com.client.Dispatch ('word.application')
This is how I got it to work.
I've tested it using JDK 1.6 (32bit) on my Windows 7 64bit machine.
- Install 32bit JDK.
- Copy 'win32com.dll' to JDK_HOME\jre\bin.
- Copy 'javax.comm.properties'to to JDK_HOME\jre\lib.
- Copy 'comm.jar'to to JDK_HOME\jre\lib\ext.
Now run your program and it should work.
Recent 2.2pre versions of RXTX include binaries for 64-bit windows. I think the latest RXTX information source has changed to this: http://rxtx.qbang.org instead of http://www.rxtx.org though.
At one point the RXTX library included drop-in support for using the javax.comm api. I'm not sure if it still does, but the main change then to use the "native" RXTX packaging was primarily just a package name change.
Start a command line with admin rights.
python -m pip install pywin32C:\Program Files\Stackless36\Scripts>python pywin32_postinstall.py -installThe pathC:\Program Files\Stackless36\should be replaced with the path at which your Python version is installed.Test (admin rights optional) using
python -c "import win32com"orpython speak.pywhere
speak.pyconsists of this text:import win32com.client speaker = win32com.client.Dispatch("SAPI.SpVoice") speaker.Speak("It works. Hoorah!")
Working fine on Python 3.6.4 Stackless 3.1b3 060516 (v3.6.4-slp:9557b2e530, Dec 21 2017, 15:23:10) [MSC v.1900 64 bit (AMD64)] on win32. Vanilla CPython hangs out here:
C:\Users\C\AppData\Local\Programs\Python\Python36-32>python.exe
Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 16:07:46) [MSC v.1900 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import win32com.client
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'win32com'
>>> exit()
C:\Users\C\AppData\Local\Programs\Python\Python36-32>python.exe -m pip install pywin32
Collecting pywin32
Cache entry deserialization failed, entry ignored
Downloading https://files.pythonhosted.org/packages/d4/2d/b927e61c4a2b0aaaab72c8cb97cf748c319c399d804293164b0c43380d5f/pywin32-223-cp36-cp36m-win32.whl (8.3MB)
100% |████████████████████████████████| 8.3MB 50kB/s
Installing collected packages: pywin32
Successfully installed pywin32-223
You are using pip version 9.0.3, however version 10.0.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
Check sys.path to make sure the directory where the module is installed is in there, otherwise you have to add it (google PYTHONPATH windows for some help with that.)