Your this.excel
property creates a new Excel process each time it is evaluated, so calling Dispose
creates one process and then quits it immediately, and another process just for calling Marshal.ReleaseComObject
on. That second one is probably the one that is staying alive.
Change your code to something like this:
module Excel =
type Application() =
let m_excel = new Excel.ApplicationClass()
member private this.excel = m_excel
interface IDisposable with
member this.Dispose() =
this.excel.Quit()
Marshal.ReleaseComObject(this.excel) |> ignore