Excel instance in Task Manager

F

FuzzyLogic

I created instance of the Excel.Application as following

On Error Resume Next
Set objExcel = GetObject (,"Excel.Application")
If err.number > 0 then
CreateObject("Excel.Application")
End if

But the problem is that on closing of my VB application, I m
terminating the excel instance as follow

Set objExcel = Nothing

But despite closure of the VB application, the excel instance remains
in the Task Manager.
After if I open any other work from Explorer or from my VB Application,
the workbook dont become visible.

Any suggestions...
 
C

Chip Pearson

You need to Quit Excel from your code. E.g.,

objExcel.Quit


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com (e-mail address removed)
 
F

FuzzyLogic

It did not work.

I applied it in the following way.

If objExcel.Workbooks.Count =0 then
objExcel.Quit
set ObjExcel = nothing
End if

Is there anything wrong with the code.
 
F

FuzzyLogic

FuzzyLogic said:
*It did not work.

I applied it in the following way.

If objExcel.Workbooks.Count =0 then
objExcel.Quit
set ObjExcel = nothing
End if

Is there anything wrong with the code. *

The excel instance only went out of the Task Manager whenExcel is
closed from its own menu.

:rolleyes:
 
T

Tom Ogilvy

Good chance you are using unqualified references to excel objects - these
can not be release.

Everything should be reference from a releasable reference such as objExcel

This include arguments to methods and so forth

for example

objExcel.GoTo Reference:=Range("A1"), Scroll:=False

the Range("A1") would create a problem.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top