解决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);

posted @ 2013-08-18 18:41  山清石玉  阅读(13389)  评论(1编辑  收藏  举报