C#如何结束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进程

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
阅读量:51
阅读量:137
阅读量:102
阅读量:112
阅读量:83