C#源代码
Microsoft.Office.Interop.Excel.Application excelApp = new Microsoft.Office.Interop.Excel.Application();
Microsoft.Office.Interop.Excel.Workbook excelWorkBook = excelApp.Workbooks.Add();
Microsoft.Office.Interop.Excel.Worksheet excelWorkSheet = excelWorkBook.Worksheets.Add();
excelWorkSheet.Name = "blablabla";
//added cells data
excelWorkBook.SaveAs(excelPath.ToString());
excelWorkBook.Close();
excelApp.Quit();
错误信息
HRESULT 异常:0x800A03EC System.Runtime.InteropServices.COMException (0x800A03EC):异常 来自 HRESULT:0x800A03EC 在 Microsoft.Office.Interop.Excel._Workbook.SaveAs(Object Filename, Object FileFormat, Object Password, Object WriteResPassword, Object ReadOnlyRecommended, Object CreateBackup, XlSaveAsAccessMode AccessMode, Object ConflictResolution, Object AddToMru, Object TextCodepage, Object TextVisualLayout, Object Local)
OpenXML
生成的输出之一,同时在数据流中完成计算。 - Janis S.