public void PreExitExcel(DateTime excelStart, DateTime excelEnd)
{
Process[] execls = Process.GetProcessesByName("excel");
foreach (Process execl in execls)
{
DateTime starttime = execl.StartTime;
if (starttime >= excelStart && starttime <= excelEnd)
{
execl.Kill();
}
}
}
权限问题,看看你的权限