473,395 Members | 1,720 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,395 software developers and data experts.

Excel object not getting killed

I've a widows application, that makes use of an EXCEL COM object, to
run a few macros available in a EXCEL file. The object is created when
the app is started and is closed when the app is closed. The app also
has a OLEDB connection to the same file to fetch data from the file and
display it on a datagrid.

Now my trouble is that, when I release the COM object, it gets released
from smoothly, to say, but the process is still running and can be seen
in the task manager.

I tried running without the OLEDB connection and the obj got destroyed
cleanly. Any guesses as to whats causing this??? Also, can anyone
suggest me, if there are ways to connect and query the object???

Pls respond, as I'm stuck with this for almost a day...

Dec 21 '05 #1
4 1745
Hi,

Use marshal.releasecomobject

oExcel.Quit()
Marshal.ReleaseComObject(oExcel)
GC.Collect()

Ken
--------------------
"Mr.Doubt" <di*********@gmail.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
I've a widows application, that makes use of an EXCEL COM object, to
run a few macros available in a EXCEL file. The object is created when
the app is started and is closed when the app is closed. The app also
has a OLEDB connection to the same file to fetch data from the file and
display it on a datagrid.

Now my trouble is that, when I release the COM object, it gets released
from smoothly, to say, but the process is still running and can be seen
in the task manager.

I tried running without the OLEDB connection and the obj got destroyed
cleanly. Any guesses as to whats causing this??? Also, can anyone
suggest me, if there are ways to connect and query the object???

Pls respond, as I'm stuck with this for almost a day...

Dec 21 '05 #2
"Mr.Doubt" <di*********@gmail.com> schrieb:
I've a widows application, that makes use of an EXCEL COM object, to
run a few macros available in a EXCEL file. The object is created when
the app is started and is closed when the app is closed. The app also
has a OLEDB connection to the same file to fetch data from the file and
display it on a datagrid.

Now my trouble is that, when I release the COM object, it gets released
from smoothly, to say, but the process is still running and can be seen
in the task manager.


PRB: Office Application Does Not Quit After Automation from Visual Studio
..NET Client
<URL:http://support.microsoft.com/?scid=kb;EN-US;317109>
-> "Troubleshooting"

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Dec 21 '05 #3
It is normal situation. Being an automation server Excel stay in memory for
some time being (same with Word ect.) ... & then it will be released
automatically (< 1 minute). You shouldn't take care about this :)

- Yuri
"Mr.Doubt" <di*********@gmail.com> ???????/???????? ? ???????? ?????????:
news:11**********************@g47g2000cwa.googlegr oups.com...
I've a widows application, that makes use of an EXCEL COM object, to
run a few macros available in a EXCEL file. The object is created when
the app is started and is closed when the app is closed. The app also
has a OLEDB connection to the same file to fetch data from the file and
display it on a datagrid.

Now my trouble is that, when I release the COM object, it gets released
from smoothly, to say, but the process is still running and can be seen
in the task manager.

I tried running without the OLEDB connection and the obj got destroyed
cleanly. Any guesses as to whats causing this??? Also, can anyone
suggest me, if there are ways to connect and query the object???

Pls respond, as I'm stuck with this for almost a day...

Dec 21 '05 #4
Actually, unless you specifically issue the Quit method to your excel
object, excel will remain in memory until you reboot. Word is the same.

Mike Ober.

"Yuri O" <a@a.a> wrote in message
news:uM**************@TK2MSFTNGP12.phx.gbl...
It is normal situation. Being an automation server Excel stay in memory for some time being (same with Word ect.) ... & then it will be released
automatically (< 1 minute). You shouldn't take care about this :)

- Yuri
"Mr.Doubt" <di*********@gmail.com> ???????/???????? ? ???????? ?????????:
news:11**********************@g47g2000cwa.googlegr oups.com...
I've a widows application, that makes use of an EXCEL COM object, to
run a few macros available in a EXCEL file. The object is created when
the app is started and is closed when the app is closed. The app also
has a OLEDB connection to the same file to fetch data from the file and
display it on a datagrid.

Now my trouble is that, when I release the COM object, it gets released
from smoothly, to say, but the process is still running and can be seen
in the task manager.

I tried running without the OLEDB connection and the obj got destroyed
cleanly. Any guesses as to whats causing this??? Also, can anyone
suggest me, if there are ways to connect and query the object???

Pls respond, as I'm stuck with this for almost a day...



Dec 30 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Josema | last post by:
Hi to all, I have a windows application that uses workbooks, sheets, ranges, etc... This application is consumed by few clients. Some weeks ago I had problems to kill excel.exe process but i...
10
by: Lars-Erik Aabech | last post by:
Hi! This issue have been discussed a lot, but I haven't found a solution that applies to ASP.NET. I have a library which does some operations on Excel documents, and it will be used in an...
1
by: Micke | last post by:
I want to open Excel from an aspx page, put some records in there, format them and close the excel file. I can't open the Excel application. It says Cannot create ActiveX component. Here is the...
2
by: Praveen K | last post by:
I have a problem in communicating between the C# and the Excel Interop objects. The problem is something as described below. I use Microsoft Office-XP PIA dll’s as these dll’s were been...
1
by: Vikram | last post by:
excel object not getting killed even after calling System.Runtime.InteropServices.Marshal.ReleaseComObjec. Is there any workaround
16
by: alexia.bee | last post by:
Hi all, In some weird reason, excel instance won;t die if i remove the comment from 4 lines of setting values into struct. here is a snipcode public...
0
by: liam_jones | last post by:
I'm very new to Python, well IronPython to precise, and have been having problems when using Excel. The problem I'm having is the closing of my Excel object. I'm able to successfully quit the...
7
by: =?Utf-8?B?VGVycnkgSG9sbGFuZA==?= | last post by:
I have a vb.net app that opens an excel worksheet, reads data and then closes the sheet. Im noticing that the Excel process is still running after I have closed and disposed of my excel objects. ...
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.