المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Get Object Reference for an already running EXCEL.EXE



C# Programming
02-25-2010, 12:40 PM
I’m trying to get a Microsoft.Office.Interop.Excel.Application refrence from a Process that identifies a running Excel.exe

This is where I am…
System.Diagnostics.Process[] apps = System.Diagnostics.Process.GetProcessesByName("EXCEL");
foreach (System.Diagnostics.Process p in apps)
{
Microsoft.Office.Interop.Excel.Application thisApp = ?????????????;
}
I haven’t been able to find any answers to this question (but have found a few others that asked it). Any ideas?

Thank you for your time,
Matt