Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

:confused: I am building an application that reads an excel file and inputs the information into the application for further use, when I finished using the excel object I close but the process is still alive, so I commented everything in my code and just left the following

 

Dim oXL As Excel.Application

Dim oWB As Excel.Workbook

oXL = CreateObject("Excel.Application")

oXL.Workbooks.Open(FilePath.Text)

oWB.Close()

oXL.Quit()

oWB = Nothing

oXL = Nothing

 

But still the process stays alive until I close my entire application. The code that you see above is run in a sub inside of a child window. I was also trying to see if oXL.hwnd will some how help me identify the process so I could kill it using the process class but no luck. So finally I just used some methods of the process class to kill a Excel process that it finds, wich is all good if only one Excel process is running in the computer but if more than one is running I could get into trouble closing something that I should not.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...