[python-win32] Fresh excel session

Mark Hammond mhammond at skippinet.com.au
Wed Feb 22 01:00:09 CET 2006


> Hi,
>   I wrote a small app that is able to open a excel ssheet with
> the win32com
> module. My problem is that it opens the new excel in the current
> excel session
> ( if available ). Is there a way of opening a fresh new excel
> session with the
> following script and not interferate with my current working session.
>
>
> import win32com.client
>
> xlApp =  win32com.client.Dispatch('Excel.Application')

Try using win32com.client.DispatchEx() instead - that doesn't call
GetActiveObject() first, so should start a new instance.

Cheers,

Mark



More information about the Python-win32 mailing list