473,651 Members | 2,765 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1761
Hi,

Use marshal.release comobject

oExcel.Quit()
Marshal.Release ComObject(oExce l)
GC.Collect()

Ken
--------------------
"Mr.Doubt" <di*********@gm ail.com> wrote in message
news:11******** **************@ g47g2000cwa.goo glegroups.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*********@gm ail.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.microso ft.com/?scid=kb;EN-US;317109>
-> "Troubleshootin g"

--
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*********@gm ail.com> ???????/???????? ? ???????? ?????????:
news:11******** **************@ g47g2000cwa.goo glegroups.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******** ******@TK2MSFTN GP12.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*********@gm ail.com> ???????/???????? ? ???????? ?????????:
news:11******** **************@ g47g2000cwa.goo glegroups.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
13328
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 solve with this sentence: System.Runtime.InteropServices.Marshal.ReleaseComObject(o);
10
3057
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 ASP.NET application. If I use the library in a Forms application, the Excel process is removed when the cleanup operations are done, but with ASP.NET all possible ways to clean up fails. The following code has been tried:
1
1902
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 code: Imports Excel = Microsoft.Office.Interop.Excel Public Class MG Inherits System.Web.UI.Page
2
5430
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 recommended by many for web applications. I create the instances of Excel, Workbook and the worksheet. And later on Release the references by “System.Runtime.InteropServices.Marshal.ReleaseComObject(Object)” and making the object as null finally....
1
1089
by: Vikram | last post by:
excel object not getting killed even after calling System.Runtime.InteropServices.Marshal.ReleaseComObjec. Is there any workaround
16
2689
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 System.Collections.Generic.List<frmMain.sDBTest> LoadTestSet(string TestSetFile, System.Collections.Generic.List<frmMain.sDBTestDBviewList)
0
2741
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 Excel Application that I create, but when I open a Workbook in the Application I can't successfully Quit Excel (by this I mean I can quit it, but the Excel process isn't getting killed and I have to manually go this through Task Manager). I've...
7
2159
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. The following code (Test1) demonstrates the essence of what I am doing. When I check the processes while ruinning the method, I notice that the Excel process remains after exiting the sub (and until I exit the application) Sub Test1 Dim...
0
8357
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
8277
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8803
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8700
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8465
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8581
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7298
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6158
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
1910
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.