Questions tagged [pythoncom]

PythonCOM is a module, encapsulating the OLE automation API.

PythonCOM is a module, encapsulating the OLE automation API.

http://timgolden.me.uk/pywin32-docs/html/com/win32com/HTML/PythonCOM.html

108 questions
23
votes
7 answers

ImportError: No module named pywintypes

I am working to make a small keylogger with Python, by using the pyHook, pythoncom and Pywin32 modules. Here is my code: import pyHook, pythoncom, sys, logging file_log = 'C:\\important\\log.txt' def OnKeyboardEvent (event): …
Eden Pigram
  • 349
  • 1
  • 3
  • 7
12
votes
4 answers

pythoncom crashes on KeyDown when used hooked to certain applications

I wrote this code on to observe the event of a keydown motion. The problem appears to be that when this script is run, certain programs will crash this program, spitting out this error message: TypeError: KeyboardSwitch() missing 8 required…
Kevin
  • 121
  • 1
  • 4
9
votes
2 answers

Python running MessageQueue.Peek via win32com, how to get timeout right?

For starters, I would like to say if anyone can help here, you are incredible. General Question My Python program needs to interact with MSMQ. Basically, I want to peek at a queue, specifying a timeout if there's nothing in the queue. However,…
Intrastellar Explorer
  • 3,005
  • 9
  • 52
  • 119
8
votes
2 answers

How to continuously monitor a new mail in outlook and unread mails of a specific folder in python

I want to check for a particular sender email and process it automatically wherever it arrives However, there may be some situation where my outlook was restarted, mean while i received mail from sender and marked as unread For continuous monitor…
sireesha
  • 135
  • 1
  • 2
  • 11
6
votes
1 answer

Python - pythoncom.PumpMessages()

I'm surprised to see that there is not a lot of explained documentation on the function pythoncom.PumpMessages(), or for the pythoncom module. So what does pythoncom.PumpMessages() and pythoncom.PumpWaitingMessages()do and how? All I really know…
user3818650
  • 581
  • 1
  • 7
  • 19
6
votes
1 answer

How to copy a table from excel to word using pythonCOM

Is it possible to get the table from excel file and paste it to the word document saving its excel style? I didn't find adequate documentation about win32com and all its methods. I've found a method PasteExcelTable, and I guess I should select the…
Vladimir
  • 601
  • 2
  • 7
  • 13
5
votes
0 answers

outlook pywintypes.com_error when sending an email

The first time I send an email using outlook, it succeeds. Then, in the second loop iteration, it fails import threading import pythoncom # to lauch mails in threads import win32com.client as win32 # pip install pywin32, pip install pypiwin32 from…
vadtam
  • 343
  • 4
  • 15
5
votes
1 answer

Python Com Server unable to create instance when wrapped with py2exe - error object has no attribute

I've hit a wall with this one. I need to create a python based com server, package it as a windows exe and deploy it on windows. It has to have a "full" interface - because the consumer requires idispatch and a specific interfce to function. Now…
user2709214
  • 185
  • 2
  • 12
5
votes
1 answer

Python win32api.mouse_event TypeError

import sys import win32api, win32con import pyHook import pythoncom def CursorLeft(): win32api.mouse_event(win32con.MOUSEEVENTF_MOVE, -1, 0) win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, 0, 0) …
Junkah
  • 51
  • 1
  • 3
4
votes
1 answer

Pythoncom - Passing same COM object to multiple threads

Hello :) I´m a complete beginner when it comes to COM objects, any help is appreciated! I´m working on a Python program supposed to read incoming MS-Word documents in a client/server fashion, i.e. the client sends a request (one or multiple MS-Word…
NB149
  • 103
  • 6
4
votes
2 answers

Anaconda Environment Error - procedure entry point could not be located for pythoncom38.dll

I created a new environment in Anaconda 2.0.3 using Python 3.8.8 using conda create -y --name gpu_env python=3.8. In the next step, I install nb_conda using conda install nb_conda. I repeatedly get the following error message at the execution…
geoabram
  • 125
  • 2
  • 11
4
votes
2 answers

How to properly wait to check if an Excel instance has closed after attempting to?

I'm using the Python standard library modules and the pythoncom and win32com.client modules from the PyWin32 package to interact with Microsoft Excel. I get a list of the running Excel instances as COM object references and then when I want to close…
user7393973
  • 2,270
  • 1
  • 20
  • 58
4
votes
0 answers

Why EnsureDispatch creating new instances?

We are developing server solution with IIS+fastcgi+django. The main aspect is Excel interoperability-opening files/reading/writing. When we were working with 32х Win Server 2012 + MS Excel 2007 + IIS7 EnsureDispatch method was working as expected.…
A. Akzhigitov
  • 179
  • 2
  • 14
4
votes
2 answers

COM error using Python 32 bit on Windows 10 64 bit

I am trying to work with a windows dll from the odoo 9 code. The code in the python class is: import win32com.client import pythoncom Pythoncom.CoInitialize () Zk = win32com.client.Dispatch ('zkemkeeper.ZKEM.1') When I run it on Windows 8 (64 bit)…
Dayana
  • 1,500
  • 1
  • 16
  • 29
4
votes
1 answer

Marshaling COM objects between Python processes using pythoncom

I'm hoping someone can help me with being able to make a marshaled cross-process call into Excel from Python. I have an Excel session initiated via Python that I know will be up and running when it needs to be accessed from a separate Python…
Switage
  • 151
  • 7
1
2 3 4 5 6 7 8