469,950 Members | 2,029 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,950 developers. It's quick & easy.

In .NET, EXCEL process still alive after quitting.

Hello,

In my .NET code behind, I open up an excel file, and process all the rows in
the worksheet that I'm interested in. Problem is when I'm done and issue the
quit method. The EXCEL process still exists in task manager (owner is
ASPNET). Here is the code:

Dim xcl As New Excel.Application
Dim wbk As Excel.Workbook
Dim xs As Excel.Worksheet

wbk = xcl.Workbooks.Open("c:\DwgNumLog1.xls")
xs = CType(wbk.Sheets.Item(2), Excel.Worksheet)

' Do my work on the worksheet
' xcl.Workbooks.Close()

xcl.Quit()
xcl = Nothing

I commented out the workbooks close because it was causing the app to hang,
perhaps if I could execute that command the EXCEL process would close when
the Quit executes. Any ideas would be greatly appreciated!!

Thanks - Hedge
Nov 22 '05 #1
1 1546
Tony,

See http://www.dotnetinterop.com/faq/?q=OfficeCleanup

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 22 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Mike | last post: by
3 posts views Thread by Stephen Brooker | last post: by
reply views Thread by tsansoterra | last post: by
12 posts views Thread by D. Shane Fowlkes | last post: by
1 post views Thread by George | last post: by
6 posts views Thread by Darrell Wesley | last post: by
3 posts views Thread by KaNos | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.