Richter Prozess zu einer 'Excel Instanz' ermitteln

Hallo,

ich will mit c# ein Excel Objekt erzeugen und dann herausfinden, welcher der zugehörige Prozess ist.

Ist das irgendwie möglich? Wenn ja wie?

private void button5_Click(object sender, EventArgs e)
{

Excel.Application myExcel = new Excel.Application();

var procList = Process.GetProcessesByName(„EXCEL“);

for (int i = 0; i
Vielen Dank für eure Infos.

Thomas

Habe eine Lösung gefunden:
Mit
GetWindowThreadProcessId
kann ich die Prozess ID ermitteln und den Prozess dann „killen“

[DllImport(„user32.dll“)]
public static extern uint GetWindowThreadProcessId(int hWnd, out int processId);

int processId;
GetWindowThreadProcessId(exl.Hwnd, out processId);
Process.GetProcessById(processId).Kill();

Thomas