The code you posted doesn't look right, but I suspect your code is not properly 
cleaning up all references to Excel objects before terminating, and you will 
find you still have an Excel process in the background which is hanging on to 
the file (hence the sharing violations).

I have encountered this with scripts that encounter unhandled exceptions.

You must ensure that you release all Excel object references before calling the 
Quit method on the Excel object.  Using a function or class to encapsulate the 
Excel operations can make this easier.
To make it reliable, comprehensive exception handling will also be required.

-------------------------> "These thoughts are mine alone!" <---------
Andrew MacIntyre           Operations Branch
tel:   +61 2 6219 5356     Communications Infrastructure Division
fax:   +61 2 6253 3277     Australian Communications & Media Authority
email: andrew.macint...@acma.gov.au<mailto:andrew.macint...@acma.gov.au>        
    http://www.acma.gov.au/

From: python-win32-bounces+andrew.macintyre=acma.gov...@python.org 
[mailto:python-win32-bounces+andrew.macintyre=acma.gov...@python.org] On Behalf 
Of The Little Guy
Sent: Wednesday, 24 August 2011 11:08 AM
To: python-win32@python.org
Subject: Re: [python-win32] Opening, Modifying, and Saving an Excel File from 
Python? (Tim Roberts)


Mr. Roberts,



I've actually, gone through the, routine of placing quit in multiple places but 
still I get errors.

Either an unknown process error is generated or another instance of Excel pops 
up, with a SaveAs

dialog, box, with a random filename as default.  Something has grabbed the 
excel file.



NOTICE: This email message is for the sole use of the intended recipient(s) 
 and may contain confidential and privileged information. Any unauthorized 
 review, use, disclosure or distribution is prohibited. If you are not the 
 intended recipient, please contact the sender by reply email and destroy all 
 copies of the original message.
_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to