zoukankan      html  css  js  c++  java
  • 解决C#导出excel异常来自 HRESULT:0x800A03EC的方法 .

    这个错误也搞了我好久,换了很多版本,后面在网上查到用xlWorkbookNormal来替代 xlExcel?,立马就可以了。

    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 版本,最好用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);

  • 相关阅读:
    BZOJ3669
    HDU3726
    BZOJ3282
    BZOJ2843
    Link/cut Tree
    Codeforces396A
    LOJ6277~6285 数列分块入门
    Codeforces446C
    Codeforces475D
    Codeforces103D
  • 原文地址:https://www.cnblogs.com/houzuofeng/p/3370632.html
Copyright © 2011-2022 走看看