1、项目中,引用添加office COM组件

2、引用接口

3、在程序中 添加代码[DllImport("User32.dll"挢旗扦渌;, CharSet = CharSet.Auto)]public static extern int GetWindowThreadProcessId(IntPtr hwnd, out int ID);

4、停止Excel应用,这一步不会马上结束Excel进程,但是需要写

5、立即结束Excel进程

1、项目中,引用添加office COM组件
2、引用接口
3、在程序中 添加代码[DllImport("User32.dll"挢旗扦渌;, CharSet = CharSet.Auto)]public static extern int GetWindowThreadProcessId(IntPtr hwnd, out int ID);
4、停止Excel应用,这一步不会马上结束Excel进程,但是需要写
5、立即结束Excel进程