Excel won't quit from VB.NET
I've read zillions of threads on this and can't figure out why Excel process
is still running. Can someone help? Private ExcelApp As Excel.Application Private oBooks As Excel.Workbook Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click CreateObject("Excel.Application") Wb = ExcelApp.Workbooks.Open("C:\Book1.xls") End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click ExcelApp.Workbooks.Close() '(or Wb.Close) ExcelApp.Quit End Sub I don't get why even after ExcelApp.Quit, Excel.exe still appears in task manager... Atchoum |
Excel won't quit from VB.NET
I rearranged your code slightly and I don't get excel process still running
when I do it this way: Private ExcelApp As Excel.Application Private oBooks As Excel.Workbook Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As _ System.EventArgs) Handles Button1.Click ExcelApp = New Excel.Application ExcelApp.Visible = True oBooks = ExcelApp.Workbooks.Open("C:\Book1.xls") End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As _ System.EventArgs) Handles Button2.Click ExcelApp.Workbooks.Close() '(or Wb.Close) ExcelApp.Quit() End Sub HTH, Dave "Atchoum" wrote: I've read zillions of threads on this and can't figure out why Excel process is still running. Can someone help? Private ExcelApp As Excel.Application Private oBooks As Excel.Workbook Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click CreateObject("Excel.Application") Wb = ExcelApp.Workbooks.Open("C:\Book1.xls") End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click ExcelApp.Workbooks.Close() '(or Wb.Close) ExcelApp.Quit End Sub I don't get why even after ExcelApp.Quit, Excel.exe still appears in task manager... Atchoum |
All times are GMT +1. The time now is 05:06 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com