Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
can't quit excel maven Excel Discussion (Misc queries) 0 March 15th 07 12:31 AM
vba advice how 2get a input box to quit by entering the word quit+ 4 a msgbox to disp RELWOD85[_4_] Excel Programming 3 August 1st 05 07:11 PM
Excel Won't Quit Rex Excel Programming 13 May 11th 05 01:51 PM
Excel doesn't quit Jos Vens Excel Programming 2 February 27th 04 01:08 AM
Excel won't quit Jeff[_23_] Excel Programming 0 October 24th 03 05:14 PM


All times are GMT +1. The time now is 02:20 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"