Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Closing an Excel app through VB

Status
Not open for further replies.

mts176

MIS
Apr 17, 2001
109
US
I am currently using VB 6 and opening Excel 2000 when the VB application starts up. It opens excel fine and when you exit the VB application excel closes fine, the only problem is when you go into task manager and look at processes Excel.exe still shows. It shows as many times as you have run the VB application. How can I ensure that excel closes out totally when the VB is shut down properly? Thanks for your help.
 
Make sure you use the quit method.

'Close and save the workbook (replace xlBook with whatever you named your workbook variable)
xlBook.Close True

'Quit Excel (replace xl with whatever you named your Excel variable)
xl.Quit
 
This is a problem with Word as well. Setting your reference to Nothing (or just letting it go out of scope) does not close down the Office application; it just loses your link to it so you are left with an 'orphan' process. In either case, you must issue .Quit first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top