Win32COM & Detaching from automation servers

dsavitsk dsavitsk at e-coli.net
Wed Sep 18 02:53:41 EDT 2002


"Brian" <codeapocalypse at msn.com> wrote in message
news:ef3269df.0209171441.2d6f8e59 at posting.google.com...
> I've searched this newsgroup for an answer to my problem, but haven't
> come up with anything.  (Perhaps the solution is obvious and I'm just
> not seeing the forest for the trees...)
>
> I want to write a Python program on Windows which will use the
> automation interface for Excel.  What I want it to do is launch Excel,
> open a template, stuff data into it (based on command line parameters
> to the Python app), detach from Excel and exit, leaving Excel open.
>
> I know how to do everything except for the detach part.  Any help is
> much appreciated.

I don't know the real answer (or if there is one other than it seems to work
from Word and not from Excel), but one solution might be to save the
generated file, close it, and call WinExec() or its ilk to reopen the file
visibly.

-doug





More information about the Python-list mailing list