Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/317.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/three.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Excel中使用interopServices C#的COMException_C#_Excel_Comexception_Interopservices - Fatal编程技术网

在Excel中使用interopServices C#的COMException

在Excel中使用interopServices C#的COMException,c#,excel,comexception,interopservices,C#,Excel,Comexception,Interopservices,在一些机器上安装程序时,我遇到了一个非常恼人的问题,我开发了一个C#应用程序,一切正常,我在另一台机器上测试了它,没有问题,但当我在客户端机器上安装程序时,出现了以下问题: System.Runtime.InteropServices.COMException(0x800A03EC):异常 来自HRESULT:0x800A03EC 在 System.RuntimeType.ForwardCallToInvokeMember (字符串memberName、BindingFlags标志、对象目标、

在一些机器上安装程序时,我遇到了一个非常恼人的问题,我开发了一个C#应用程序,一切正常,我在另一台机器上测试了它,没有问题,但当我在客户端机器上安装程序时,出现了以下问题:

System.Runtime.InteropServices.COMException(0x800A03EC):异常 来自HRESULT:0x800A03EC 在 System.RuntimeType.ForwardCallToInvokeMember (字符串memberName、BindingFlags标志、对象目标、Int32[]aWrapperTypes、MessageData和msgData) 在Microsoft.Office.Interop.Excel.Range.set\u默认值(对象行索引、对象列索引、对象) 在学校管理、证书继承、总结操作()

当程序与Excel、Office和Microsoft通信时(我试图安装另一个Office版本,但没有成功)。
我已经搜索了很多解决方案,但没有任何效果,因为它声称问题只是以下路径中的权限问题

C:\Windows\System32\config\SystemProfile

为什么程序能在我的测试机上顺利、成功地运行,而不是在我客户的测试机上运行,真让我抓狂!!

请给我任何建议。

经过几周又几周的搜索和挖掘,我终于找到了答案!。
这只是区域设置的问题!!是的,我不知道为什么,但Microsoft Office就是这样工作的,控制面板上的区域设置应该是英语,而不是任何其他语言,因为我在阅读不同用户的信息。

因此,如果您想从C#应用程序使用Microsoft Office,请确保您的区域设置为英语

我也遇到了同样的问题,经过几次试用,我了解到一些已安装的Excel(2013)版本设置了与Excel 2003兼容的选项(常规选项)。在这种情况下,新创建的文件只接受255列和65.535行。当我的应用程序处理数千列时,excel生成了错误。
简单的解决方案是更改常规选项,并将“保存的文件格式”设置为“.xlsx”而不是“.xls”

O.O down vote!为什么我只是在寻求帮助,甚至是解释…无论如何