Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / April 2005

Tip: Looking for answers? Try searching our database.

Excel Process

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kenneth Hutson - 18 Apr 2005 14:12 GMT
I wrote this code in VB2005 Express Beta. When the Sub ends, Excel still
shows as a running process in the Task Manager. How do I shut Excel down?

Thanks,

Kenneth Hutson

San Antonio, TX

[code]

Imports Microsoft.Office.Interop

Module DataSet2Excel

Sub startxl()

Dim xlapp As Excel.Application

Dim wb As Excel.Workbook

Dim ws As Excel.Worksheet

Dim r As Excel.Range

xlapp = New Excel.Application

xlapp.Visible = True

wb = xlapp.Workbooks.Add

ws = CType(wb.Worksheets.Add, Excel.Worksheet)

xlapp.Workbooks.Close()

xlapp.Quit()

End Sub
Chuck - 18 Apr 2005 16:24 GMT
Try

xlapp.Application.Quit()

Also

xlapp = nothing
or
set xlapp = nothing (not familiary with VB2005 but in VBA you'd set the
xlapp object with
 set xlapp = New Excel.Application
and you'd destroy it with
 set xlapp = nothing

You may also need to destroy your ws object.

> I wrote this code in VB2005 Express Beta. When the Sub ends, Excel still
> shows as a running process in the Task Manager. How do I shut Excel down?
[quoted text clipped - 34 lines]
>
> End Sub
Perry - 18 Apr 2005 22:08 GMT
I'm wondering how the Quit() method is part of the Excel.Application
namespace.
Did you get this line through the JIT compiler ?

Try to instantiate the Excel object using :
Dim xlapp As New Excel._ApplicationClass()

You can also try to Dispose() the "xlapp" object or force the GC (garbage
collector) to collect.

Krgrds,
Perry

> I wrote this code in VB2005 Express Beta. When the Sub ends, Excel still
> shows as a running process in the Task Manager. How do I shut Excel down?
[quoted text clipped - 34 lines]
>
> End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.