Re: [python-win32] How to correctly handle events using win32com ?

2024-11-29 Thread Gauthier ABRIAL
For some reasons the PumpWaitingMessages() is never returning 1, even if it seems that Excel has been properly closed and the process ended. My problem is that once I have called "WithEvents", if I stop calling PumpWaitingMessages() Excel is freezing because it's waiting for the events to be pr

Re: [python-win32] How to correctly handle events using win32com ?

2024-11-29 Thread dornech via python-win32
Hi there, exactly, Mark is right on this. You can use very COM object method as you use out of VBA for example. I am working on a wrapper for a more "pythonized" access to the EXCEL API, you may have alokk on it as soon as it is published. BG Chris Am 29.11.2024 um 20:10 schrieb Mark Hammond

Re: [python-win32] How to correctly handle events using win32com ?

2024-11-29 Thread Mark Hammond
It's been a while since I've done any of this, but I think there's an "xlApp.Quit()" method you can use? If so, then you might be able to break out of the look when "PumpWaitingMessages()" returns 1 - that will mean the message queue has received a WM_QUIT. On 2024-11-29 12:17 p.m., Gauthier

[python-win32] How to correctly handle events using win32com ?

2024-11-29 Thread Gauthier ABRIAL
Hello, I'm looking for some advice on how to correctly handle events using win32com. If I take the example of a very simple Excel automation, I tested two things. * Code1 below use pythoncom.PumpMessages() but I don't know how to stop it when the Excel is closing. I guess I should send a WM_QU