interesting problem

A

Amod

Hi
all
I do the following coding in vb 6.0
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dim xlApp As New Excel.Application
Dim xlWorkbook1 As Excel.Workbook

Private Sub Form_Load()
Set xlWorkbook1 = xlApp.Workbooks.Open
("c:\winnt\temp\temp1.htm")
xlWorkbook1.SaveAs ("c:\winnt\temp\book2.xls")

End Sub
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
when I execute this code,Excel window gets open and
shows "book2.xls". if I close this excel window then
also "excel.exe" runs in the background. you can see this
in the task manager.please tell me the solution to unload
this "excel.exe" when I close the excel window.
If I add the line "xlApp.quit" at end, then
that "excel.exe" goes. but I can't add this line because I
want to show that "book2.xls" file to user.

Please reply as soon as possible

regards
Amod
 
A

Amod

to sir
I declare the xlworkbook object with withevents keyword
as"Dim WithEvents eveXlWorkbook1 As Excel.Workbook" but
there is no "onclose" event for it. there is "beforeclose"
event but it is not useful.
Please give reply.
regards
Amod
 

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