Kill Process Excel C#

后端 未结 10 1586
栀梦
栀梦 2020-12-09 12:45

I have to 2 process excel. For example:

1) example1.xlsx 2) example2.xlsx

How to kill first \"example1.xlsx\"?

I use this code:

   f         


        
10条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-09 13:26

    just did a quick search on Google, try Process.MainWindowTitle() to get the title of the Excel process, and decide which one is that you want to kill.

    I am not sure about this method, but hope this will help:

    http://msdn.microsoft.com/en-us/library/system.diagnostics.process.mainwindowtitle.aspx

提交回复
热议问题