I have been searching all over for this problem, but I can't seem to find one that quite matches my issue.
I am creating a new excel file, filling it with data, and showing it to user. While monitoring the task manager i can see that once the file has been created and open for the user, the background process disappears as it is supposed to. (The main process is still running up top because the file is open.)
The problem I have is that once the user closes the file, Excel background process pops back up in list and won't go away until program (that generated the file) is closed.
This is the clean up that I am using;
Dim xlObject As New Excel.Application
Dim xlBook As Excel.Workbook = Nothing
Dim xlSheet As Excel.Worksheet = Nothing
xlBook = xlObject.Workbooks.Add
xlSheet = xlBook.Worksheets(1)
'Fill data and do some formatting
xlBook.SaveAs("FileName")
xlObject.Visible = True
System.Runtime.InteropServices.Marshal.ReleaseComObject(xlSheet)
xlSheet = Nothing
System.Runtime.InteropServices.Marshal.ReleaseComObject(xlBook)
xlBook = Nothing
System.Runtime.InteropServices.Marshal.ReleaseComObject(xlObject)
xlObject = Nothing
Is there something that I am missing? Why is the background process continuing and only go away once the creating program is closed?
This is using Visual Studios 2013, Office 365 Excel, and Windows 10 Pro