通过执行 Process.Start 命令的奇怪消息



我们有一个项目,它创建一个Excel文件并将其保存在网络共享驱动器中,然后打开该文件,应用程序工作正常,但我收到一条奇怪的消息。考虑以下代码

using Excel = Microsoft.Office.Interop.Excel;
....
xlsAppClass = new Excel.Application();
Process excelPID = GetExcelProcessId(xlsAppClass);
//
// All codes generate and save the excel file...
// and return the filePath which is located in Network Shared drive.
//
xlsWorkBook.Close();
xlsAppClass.Quit();
Marshal.ReleaseComObject(xlsSheets);
Marshal.ReleaseComObject(xlsWorksheet);
Marshal.ReleaseComObject(xlsWorkBook);
Marshal.ReleaseComObject(xlsAppClass);
if (excelPID != null) excelPID.Kill();
// When program reaches this line of code excel file created, saved and Excel process killed
// I checked the TaskManager, nothing's there.

然后我通过以下代码打开生成的文件

System.Diagnostics.Process.Start(filePath);

此时系统打开文件,但我也收到以下消息,我无法弄清楚为什么"Microsoft Office Communicator 2007 已在运行"

实际上我重新启动了PC,问题解决了!

最新更新