PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft VB .NET
Excel object not getting killed
Forums
Newsgroups
Microsoft DotNet
Microsoft VB .NET
Excel object not getting killed
![]() |
Excel object not getting killed |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
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... |
|
|
|
#2 |
|
Guest
Posts: n/a
|
Hi,
Use marshal.releasecomobject oExcel.Quit() Marshal.ReleaseComObject(oExcel) GC.Collect() Ken -------------------- "Mr.Doubt" <dina.mrcool@gmail.com> wrote in message news:1135157654.982466.214220@g47g2000cwa.googlegroups.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... > |
|
|
|
#3 |
|
Guest
Posts: n/a
|
"Mr.Doubt" <dina.mrcool@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/> |
|
|
|
#4 |
|
Guest
Posts: n/a
|
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" <dina.mrcool@gmail.com> ???????/???????? ? ???????? ?????????: news:1135157654.982466.214220@g47g2000cwa.googlegroups.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... > |
|
|
|
#5 |
|
Guest
Posts: n/a
|
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:uMyEDUmBGHA.3408@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" <dina.mrcool@gmail.com> ???????/???????? ? ???????? ?????????: > news:1135157654.982466.214220@g47g2000cwa.googlegroups.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... > > > > > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 


