日期:2014-05-17  浏览次数:20881 次

如何解决C#导出excel异常来自 HRESULT:0x800A03EC的方法

xlBook.SaveAs(FilePath,Microsoft.Office.Interop.Excel.XlFileFormat.xlExcel8, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Excel.XlSaveAsAccessMode.xlNoChange, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);

发现Office.Interop.Excel.XlFileFormat.xlExcel8格式与本机安装的office对不上,用Office.Interop.Excel.XlFileFormat.xlWorkbookNormal则可以

xlBook.SaveAs(FilePath, Microsoft.Office.Interop.Excel.XlFileFormat.xlWorkbookNormal, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Excel.XlSaveAsAccessMode.xlNoChange, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);