Thanks Kevin,

This is all new stuff to me. At the moment I do not have a handle to the
Excel window, nor do I know how to get that. Presumably this is something
that I can extract from the COM server?

This window handle of which you speak - is it anything more than a COM
object that represents the Window object of the Excel application?

Also is there a more COM / Python friendly way to kill processes than what I
currently do which is to use os.system to execute the windows Kill Process
command?

Thanks!

On 2/13/08, Kevin Horn <[EMAIL PROTECTED]> wrote:
>
> On Feb 13, 2008 7:06 AM, Salim Fadhley <[EMAIL PROTECTED]> wrote:
>
> > I'm trying to write a Python program to automate the testing of a very
> > large number of Excel spreadsheets. From time to time these spreadsheets
> > mis-behave and leave Excel in an unstable state - under those circumstances
> > I would like to kill off Excel and restart my COM server with a new process.
> >
> > Unfortunately when a Excel application object goes wrong it often does
> > not respond to quit events. Usually the only thing I can do is kill off all
> > of the Excel processes running - surely there must be a better way?
> >
> > Is there a way to find the process ID of the excel.exe process that I
> > have connected to? That way when I want to kill off a malfunctioning Excel
> > object I need to only kill the affected object.
> >
> >
> Do you have a handle to the Excel window?  If so you can get the process
> id using GetWindowThreadProcessId.
>
> There are probably other ways too, but that's what came to mind.
>
> Kevin Horn
>
>
_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to