比如说:
//创建Excel对象
Excel.ApplicationClass xlApp = new Microsoft.Office.Interop.Excel.ApplicationClass();当执行完后最后我要关闭Excel进程么 
    谁知道怎么关闭么  急啊!!!!!

解决方案 »

  1.   


    Process[] ps = Process.GetProcessesByName("qq");
                if (ps != null)
                {
                    foreach (Process p in ps)
                    {
                        p.Kill();
                    }                
                }
      

  2.   

      Process[] myProcesses;
                    DateTime startTime;
                    myProcesses = Process.GetProcessesByName(" Excel ");                // 得不到Excel进程ID,暂时只能判断进程启动时间 
                    foreach (Process myProcess in myProcesses)
                    {
                        startTime = myProcess.StartTime;                    if (startTime > beforeTime && startTime < afterTime)
                        {
                            myProcess.Kill();
                        }
                    }
      

  3.   

    没必要吧  我教你个方法吧 刚学的 
     //关闭后台Excel进程
            xlApp.Workbooks.Close();
            xlApp.Quit();
    两句搞定
      

  4.   

    保存了你的工作表和工作簿之后
    xlApp.Quit();
    就可以了