Used the Microsoft example quoted in the comments to make a simple application with three buttons, start excel, disconnect from excel and exit the form.
Did not need to disconnect, closing Excel does not close the application.
Something you are doing with the handle is causing the issue and as I am not sure what you are trying to achieve I cannot say why - rather I know why it is closing the form app just not sure what you are trying to achieve.
using Excel = Microsoft.Office.Interop.Excel;
public partial class Form1 : Form
private void button1_Click(object sender, EventArgs e)
private void button2_Click(object sender, EventArgs e)
excelApp = new Excel.Application();
excelApp.Visible = true;
excelApp.WindowState = XlWindowState.xlMaximized;
private void button3_Click(object sender, EventArgs e)
while (Marshal.ReleaseComObject(excelApp) != 0)