Home |
Search |
Today's Posts |
#10
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I experienced the same issues. I'm using .Net Interop in VB.Net. I even
followed Jim Cone's post, but no help either. How do I kill a process/thread in VB.Net? "Inbar" wrote: OK, in this case - you would to "kill" the EXCEL process. You can do this with simple C# code. Let me know if you want help. "Rex" wrote: I tried both of your examples and in both cases, Excel remains in the process list after my program ends. The fact that both of these as well as Inbar's suggestions all fail makes me think there's something wrong in my environment. In fact, the only way I've been able to get Excel to quit is to *not* do the .Open. If I comment out the .Open and .Close lines, it works fine. (Well, "work" is probably an exaggeration, but Excel goes away after the Set XL=Nothing.) Here's some more info, in case it means anything to anyone: I'm using VB 6.0 on XP SP2. Excel 2000 (9.0.6926 SP-3). The reference in my project is to Microsoft Excel 9.0 Object Library. Rex "keepITcool" wrote: you're using a mix of early and latebound code.. plus it may be easier to set a reference to the opened workbook both the routines close completely on my machine.. (even if you set xl.Visible = TRUE so you can test/see what's happening..) Sub Early() Dim XL As Excel.Application Dim WB As Excel.Workbook Set XL = New Excel.Application Set WB = XL.Workbooks.Open("C:\temp\AnyOld.XLS") WB.Close False XL.Quit Set XL = Nothing End Sub Sub Late() Dim XL As Object Dim WB As Object Set XL = CreateObject("Excel.Application") Set WB = XL.Workbooks.Open("C:\temp\Anyold.xls") WB.Close False XL.Quit Set XL = Nothing End Sub -- keepITcool | www.XLsupport.com | keepITcool chello nl | amsterdam Rex wrote : After running this code, Excel remains: Dim XL As Excel.Application Set XL = CreateObject("Excel.Application") XL.Workbooks.Open "C:\TEMP\AnyOld.XLS" XL.Workbooks.Item(1).Close False XL.Quit Set XL = Nothing Also tried .Close True and tried omitting .Close call. What am I missing? Rex |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
can't quit excel | Excel Discussion (Misc queries) | |||
Excel won't quit | Excel Discussion (Misc queries) | |||
Excel doesn't quit | Excel Programming | |||
Can't get Excel to quit | Excel Programming | |||
Excel won't quit | Excel Programming |