Link to home
Start Free TrialLog in
Avatar of cfwti
cfwti

asked on

Late binding EXCEL Proceess stays active - VB6

Problem - for a late binding EXCEL app (VB6), the process remains in the task mgr.
(Windows XP, EXCEL 2000, VB6)

First - here is a sequence that works fine.

set  xlsapp = CreateObject("EXCEL.APPLICATION")
xlsapp.quit
Set xlsapp = nothing

With this sequence, the EXCEL process is ended, as indicated by viewing the Windows Task Mgr.


Second - here is a sequence that does not work - the EXCEL process remains active as indicated by viewing the Task Mgr

set  xlsapp = CreateObject("EXCEL.APPLICATION")

rows("10").Select  'this type of statement results in the EXCEL process remaining active in the TaskMgr

xlsapp.quit
Set xlsapp = nothing

Do I need to do something with the "rows" or "Selection" properties before quiiting xlsapp?

Any help is greatly appreciated.  Thank you
Avatar of Harisha M G
Harisha M G
Flag of India image

Hi,

It may be a good idea to close the workbook before quitting

---
Harish
ASKER CERTIFIED SOLUTION
Avatar of pratap_r
pratap_r
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of cfwti
cfwti

ASKER

Hi Pratap,

You certainly pointed me in the right direction.  The fix is shown below:

replace the the line of code --          rows(10).select

with  --           xlsapp.rows(10).select.

Apparantly, using the "rows" property (or any other application property) without the application prefix ("xlsapp.") creates an orphan.

Thanks,
cfwti