[python-win32] Re: Excel corrupted display problem

Roger Upole rwupole at msn.com
Mon Aug 21 12:47:56 CEST 2006


John Henry wrote:
> Hi list,
> 
> I have a Python script that pops up Excel, fill it,
> and then continue.  If the user clicks on my Python
> side to  close Excel (via a call to the Quit()
> function), then I can reopen it later via another
> dispatch call and so forth.
> 
> However, if the user close Excel from the Excel side,
> next time Python side starts Excel again, the Excel
> display area (the area where the spreadsheet cells
> goes) is screwed up.  The rest of things works fine
> (like the menu bar and so forth) - but the spreadsheet
> display area is useless.
> 
> Is there any cure to this?
> 
> Thanks,
> 
> --
> John Henry

You might be able to use win32com.client.DispatchEx to start Excel.
This should make sure you always get a new Excel process,
rather than returning a reference to the one that the user closed.

           Roger



More information about the Python-win32 mailing list