前段时间做了个将Txt中数据导出到Excel中的C#小应用程序,一直都运行很好的。今天突然有同事安装时,报如下错:
************** Exception Text **************
System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.Office.Interop.Excel.Application'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{000208D5-0000-0000-C000-000000000046}' failed due to the following error: 不支持此接口 (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
at TxtToExcelDemo.ExcelOperate.ExcelFileOperate.CreateExcelFile()
at TxtToExcelDemo.MainForm.btnLoadOut_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Mess