View Single Post
 
Old 03-14-2006, 05:28 PM
bwjunkie bwjunkie is offline
Novice
 
Join Date: Mar 2006
Posts: 1
bwjunkie
Default excel not closing

i can reproduce this exact same problem with my vb.net application, and have found some interesting semi-solution

i CANNOT get excel.exe to drop out of my process list, when i automate, even trying all the above technique and using all the close/quit functions.

once i fully close my .net application, the processes dissappear.

even if i say .visible=true, and then i close it with the mouse, the process stays open.

when i close my application completely, then the excel.exe process dissappears.

im not using late binding however.
i use the new excel.application with proper office references.

not sure how this info helps, but just FYI

josh
josh at pipeline dot com

sample code below
Dim oxls As Excel.Application
Dim oBook As Excel.Workbook
Dim oSheet As Excel.Worksheet
Try
oxls = New Excel.Application
oxls.DisplayAlerts = False
oxls.Visible = False
oBook = oxls.Workbooks.Open(Me.txtGoodList.Text)
oSheet = oBook.ActiveSheet
Me.SheetToDataset(oSheet, Me.DsGOOD.tList)
oxls.Visible = True
oBook.Close(False)
oxls.Quit()
Catch ex1 As Exception
oxls.Visible = True
oBook.Close(False)
oxls.Quit()
Throw ex1
End Try
Reply With Quote