zoukankan      html  css  js  c++  java
  • close process excell

    #region Kill EXCEL
            //As a safety check go through all processes and make
            //doubly sure excel is shutdown. Working with COM
            //have sometimes noticed that the EXL.Quit() call
            //doesn't always do the job
            private void killExcel()
            {
                try
                {
                    Process[] ps = Process.GetProcesses();
                    foreach (Process p in ps)
                    {
                        if (p.ProcessName.ToLower().Equals("excel"))
                        {
                            p.Kill();
                        }
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show("ERROR " + ex.Message);
                }
            }
            #endregion

  • 相关阅读:
    js数组
    js字符串和控制语句
    生成器、列表解析
    js属性
    js函数
    js变量
    python抽象方法
    python 装饰器的缺点以及解决方法
    windows文件关联、打开方式列表之修改注册表攻略
    JavaScript定时器及其他
  • 原文地址:https://www.cnblogs.com/greencolor/p/2095045.html
Copyright © 2011-2022 走看看