I have a process that interacts with an Excel application in background, but sometimes the process has an error and the Excel Application doesn't finish correctly.
Always, when this process starts try to delete the Excel file from the hard drive.
But, when the process has an issue and I retry to run the process again, the following message shows me when I try to delete the Excel file:
"The process cannot access the file [Excel file path] because it is being used by another process."
I can not kill all processes of Excel. Then, my question is: Is there some way to know what is the process that manage this Excel? Or, Is there some way to know the process using a Try ... Catch structure?