how to kill or terminate the excel process from vb6

R

ravindar thati

dear friends, i am using ms access 2003.

i wanted to export data from access table to excel table.
so i have followed this



Dim db As Database
Dim ea As Excel.Application
Dim rs As Recordset
Dim j As String

Set ea = New Excel.Application
Set db = CurrentDb
ea.Workbooks.Add
ea.Visible = True
Set rs = db.OpenRecordset("SELECT Indicator_Values.year as yea,
Indicator_Values.[Energy use per $1 GDP (PPP)(converted unit)]as eng
FROM Indicator_Values;")
If rs.RecordCount > 0 Then
rs.GetRows
rs.MoveFirst

For i = 1 To rs.RecordCount
j = rs!Yea
k = rs!eng
ea.ActiveSheet.Cells(i, 1).Value = rs!Yea
ea.ActiveSheet.Cells(i, 2).Value = rs!eng
rs.MoveNext

Next
End If
ea.Workbooks.Close
ea.Quit
Set ea = Nothing



i worked out very well this code. i got what output i want.
but the problem here is even if i close the excel window, i see some
excel processes running in the back ground( i viewed it through task
manager).

indeed i have closed the excel window with the code

ea.Quit

even then why the excel process still running in the back ground?
how to kill that process?
 
D

Douglas J. Steele

See whether replacing

ea.Quit

with

ea.Application.Quit

makes a difference.
 
R

ravindar thati

See whether replacing

ea.Quit

with

ea.Application.Quit

makes a difference.




no friend, it didnt make any change.
the processes are still running.
this is a real memory management problem
 
R

ravindar thati

See whether replacing

ea.Quit

with

ea.Application.Quit

makes a difference.



oh yes friend it worked well.
thanq. you have solved my big memory management problem
thanq
 

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

Top