[python-win32] Opening, Modifying, and Saving an Excel File from Python?

Little Guy the_little_guy at gmx.com
Tue Aug 23 15:32:15 CEST 2011

Mr. Roberts,

 I tried your suggestion about the varialble.quit() usage but still get the same results.

 What normally happens is that I open up the excel file, and make it visible. I then try to populate two cells,
 at the last row + 1 with text, then try to save, close and quit. What occurs is that, either, sharing violations
 occur, and the script crashes, or another instance of excel pops up, with a save dialog box, asking to save
 with a random filename generated by the OS, I presume. Yesterday, I noted that there were over 15 of these
 randome filenames saved in the directory of the exce file, but all lacking an .xls extension. This occured
 eventhough, I chose not to save the excel file when the save dialog window came up. 

 No matter what I do, the workbook does not close and quit, silently saving all changes, it either crashes or
 aks to save the file, providing a different filename. 

 Thanks for the reply,

----- Original Message -----
From: python-win32-request at python.org
Sent: 08/23/11 03:00 AM
To: python-win32 at python.org
Subject: python-win32 Digest, Vol 101, Issue 22

 Send python-win32 mailing list submissions to python-win32 at python.org To subscribe or unsubscribe via the World Wide Web, visit http://mail.python.org/mailman/listinfo/python-win32 or, via email, send a message with subject or body 'help' to python-win32-request at python.org You can reach the person managing the list at python-win32-owner at python.org When replying, please edit your Subject line so it is more specific than "Re: Contents of python-win32 digest..." Today's Topics: 1. Re: SHOpenFolderAndSelectItems (Scott Nelson) 2. Re: Opening, Modifying, and Saving an Excel File from Python? (Tim Roberts) ---------------------------------------------------------------------- Message: 1 Date: Mon, 22 Aug 2011 09:10:58 -0500 From: Scott Nelson <sirgnip at gmail.com> To: mhammond at skippinet.com.au Cc: python-win32 at python.org Subject: Re: [python-win32] SHOpenFolderAndSelectItems Message-ID: <CAH30xazCoEGiJfAo=Oo8pJ_CCwgb_McA6iOtp5zEQjMw9GW_DA at mail.gmail.com> Content-Type: text/plain; charset="iso-8859-1" Done (ID #3396444) https://sourceforge.net/tracker/?func=detail&aid=3396444&group_id=78018&atid=551957 Many thanks for considering this! On Sun, Aug 21, 2011 at 10:15 PM, Mark Hammond <skippy.hammond at gmail.com>wrote: > On 20/08/2011 5:40 AM, Scott Nelson wrote: > ... > > Does pywin have support for SHOpenFolderAndSelectItems()? >> > > Unfortunately not - you can open a feature request at sourceforge and I'll > add it for the next release. > > Cheers, > > Mark > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-win32/attachments/20110822/a315b006/attachment-0001.html> ------------------------------ Message: 2 Date: Mon, 22 Aug 2011 14:01:51 -0700 From: Tim Roberts <timr at probo.com> To: Python-Win32 List <python-win32 at python.org> Subject: Re: [python-win32] Opening, Modifying, and Saving an Excel File from Python? Message-ID: <4E52C3BF.8050603 at probo.com> Content-Type: text/plain; charset="windows-1252" The Little Guy wrote: > > Hi, > > > > I apologize for the lengthy post. > > > > I?m using Python 2.7, Win 7, Excel 2003. When trying to enter a time > object and text data into a, simple, Excel 2003 file. I?ve tried > different combinations for saving the file. I?ve used > workbook.Save(), workbook.SaveAs(filename), etc. Sometimes I receive > a replace file dialog box, but other times, I receive following > message, when it tries to save: > It is important to remember that none of these cause Excel to exit: xlApp.Visible = 0 xlApp = None del xlApp If you have Excel open with your file and set Visible to 0, it can be very difficult to remember that your file is still open. You should use xlApp.Quit() in every exit path. -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. ------------------------------ _______________________________________________ python-win32 mailing list python-win32 at python.org http://mail.python.org/mailman/listinfo/python-win32 End of python-win32 Digest, Vol 101, Issue 22 *********************************************

 Little Guy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20110823/d6f21bd1/attachment.html>

More information about the python-win32 mailing list