我们有一个项目可以创建一个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已在运行"
答案 0 :(得分:0)
实际上我重新启动了PC,问题解决了!