System.Runtime.InteropServices.COMException (0x80028018):
2011-10-11 09:38
1246 查看
Exception(0x80028018)
分类:Excel 2011-01-13 14:04
20人阅读 评论(0)收藏
举报
☆Exception种类:
System.Runtime.InteropServices.COMException (0x80028018): ライブラリの形式が古いか、または種類が無効です。 (HRESULT からの例外: 0x80028018 (TYPE_E_INVDATAREAD))
☆发生条件:
C#进行Excel出力时
☆原因:
Excel自身的一个bug,当本地系统环境被设置成非英文的,而Excel是英文的时候,就会出现
☆解决方案:
方案1.需要临时设定英文环境,代码如下:
System.Globalization.CultureInfo CurrentCI = System.Threading.Thread.CurrentThread.CurrentCulture;
System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US");
方案2.到“区域与语言选项中”设定当前的区域选项为当前系统的环境
相关文章推荐
- System.Runtime.InteropServices.COMException (0x8004E00F): COM+ 无法与 Microsoft 分布式事务协调程序交谈 (异常来自 HRESU
- “System.Runtime.InteropServices.COMException”/ 其他信息: ClassFactory 无法供应请求的类 (异常来自 HRESULT:0x80040111
- System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x800AC472
- 完美解决“换另一台电脑上用VS2008继续开发web项目时出现“System.Runtime.InteropServices.COMException”,然后是加载不了项目。”
- c#程序在部分电脑运行异常解决方法(System.Runtime.InteropServices.COMException (0x80070422): 无法启动服务)
- System.Runtime.InteropServices.COMException (0x800706BA) 解决方法
- System.Runtime.InteropServices.COMException (0x800A03EC)
- System.Runtime.InteropServices.COMException
- System.Runtime.InteropServices.COMException (0x8004E00F): COM+ 无法与 Microsoft 分布式事务协调程序交谈 (异常来自 HRESU
- 验证配置设置时发生错误,已引发类型为System.Runtime.InteropServices.COMException的异常。其他异常信息:系统找不到指定的路径
- VS 2008 打开 WebApplication 报 System.Runtime.InteropServices.COMException 错误
- System.Runtime.InteropServices.COMException 检索COM类工厂中CLSID{xxxxxxxxx}的组件时失败解决方法
- “System.Runtime.InteropServices.COMException”类型的第一次机会异常在 ESRI.ArcGIS.Version.dll 中发生
- WIN7SP1 Crystal Reports异常:System.Runtime.InteropServices.ComException(0x800003E7)
- System.Runtime.InteropServices.COMException: 检索 COM 类工厂中 CLSID 为 {0002E510-0000-0000-C000-000000000046} 的组件时失败,原因是出现以下错误: 80040154
- System.Runtime.InteropServices.COMException 检索COM类工厂中CLSID{xxxxxxxxx}的组件时失败解决方法
- System.Runtime.InteropServices.COMException (0x80004005): 无法创建目录或文件
- C#读写Word文档异常处理解析System.Runtime.InteropServices.COMException
- System.Runtime.InteropServices.COMException The Product License has not been initialized. ESRI GeoDatabase
- System.Runtime.InteropServices.COMException: 内存不足,请现在保存文档。 IIS 7