473,387 Members | 1,553 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Closing an excel application

25
Hi All....

I'm using python 2.4, Win XP Pro v.2002 sp3, and I use pyscripter 1.9.9.2 as my editor.

I have written code to open an existing excel file and grab some data. The problem I am having is closing down the excel application. Here some "bits" of the code I am using:

Expand|Select|Wrap|Line Numbers
  1. xlApp = Dispatch("Excel.Application")
  2.  
  3. xlApp.Workbooks.Open(Filename = path+fname)
I am closing the workbook by doing the following:

Expand|Select|Wrap|Line Numbers
  1. xlApp.Workbooks.Close()
I am trying to quit the excel application by doing the following:

Expand|Select|Wrap|Line Numbers
  1. xlApp.quit()
The problem is when I check the windows Task Manager, the EXCEL.EXE is still present. From all I have read, this is the correct way to close the workbook and exit the excel application.

Can anyone tell me what I might be doing wrong.

Thanks in advance.

Silgd1
Jul 8 '09 #1
2 3938
Silgd1
25
I found out that you must do the following:

Expand|Select|Wrap|Line Numbers
  1. xlApp.Visible = 0
  2. del xlApp
you must make x1App.Visible=0 before you use del x1App, otherwise EXCEL.EXE remains in memory.
Jul 9 '09 #2
bvdet
2,851 Expert Mod 2GB
Thanks for updating us with the solution. I am only somewhat familiar with win32com. I usually interface with Excel using CSV files.

-BV
Jul 10 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Mark | last post by:
Hi all, as many had, i have some problems terminating the excel-process. I implemented the solutions i found in this forums. Tried most combinations of them ;-). It still doesn't work. I'll...
2
by: Atley | last post by:
I have written an application that exports data from SQL to Excel. It all works perfectly except that if you open the Task Manager after running my application, there is an instance of Excel in...
0
by: Sania | last post by:
Hi, We have an application that create an excel object on the very beginning of the application: objExcel = New Excel.Application Then I am passing the excel reference to the one of forms...
7
by: rdemyan via AccessMonster.com | last post by:
I want to make sure that I'm closing an opened spreadsheet correctly. I've been having some locking up problems. The following code adds a dummy row to the spreadsheet to ensure that that the data...
1
by: John Bailo | last post by:
I wrote a c# web service that creates an Excel spreadsheet. Even though I follow all the formal procedures for closing the app and finalizing, an instance of Excel still remains in memory. I...
6
by: pleaseexplaintome_2 | last post by:
Help please. The excel instance is removed from task manager when I run the code below. If I uncomment the lines pertaining to a workbook, the instance of excel is not removed from task manager. ...
4
by: Yoduh | last post by:
Hello, I'm fairly new to javascript. I'm making a website for my personal use that will read from Excel and display some data on an HTML page and I've been learning javascript as I go. A problem...
1
by: fakehitswizard | last post by:
this is the correct way to close excel with C#. I've seen alot of other bogus posts ALL over the web that don't work, how frustrating. string savepath; bool foundPID; int ourPID = 0; int...
2
by: Ronin85 | last post by:
Hi , I recently have much pain working with excel application especially closing excel . I try several method but with no success i try to urge garbage collector to dispose excel application object,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.