I'm trying to build a form that allows a user to select a previously opened Excel instance.
From there, I want to extract out the name of the .xlsx
file associated with that opened instance.
I suspect I'll have to use COM to get it out of there, but I haven't found a way to do it.
The code I'm thinking is as follows:
Process[] openApplications = Process.GetProcessesByName("excel");
foreach(Process p in openApplications)
{
///Find the associated .xlsx path and file
///...Maybe from the handle id?
}
Any help would be much appreciated