无法在AP.NET C#应用程序中打开生成的Excel文件 [英] Unable to open the generated Excel file in AP.NET C# Application

查看:93
本文介绍了无法在AP.NET C#应用程序中打开生成的Excel文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



Excel文件是通过ASP.NET C#Web应用程序生成的.但是在Windows Server 2008 R2和本地Windows XP中打开Excel文件时出现错误,它运行良好.
错误是 "System.Runtime.InteropServices.COMException(0x800A03EC):HRESULT异常:0x800A03EC" 我们也在IIS服务器上设置了相同的区域性设置,并且还授予了权限.我们能够在其中保存Excel文件,但无法打开它.

我们正在使用以下代码打开文件:

xlWorkBook = xlApp.Workbooks.Open(strExcelPath, 0, true, 5, "", "", false, Excel.XlPlatform.xlWindows, "",false, false, 0, true, false, false);

我要求请帮助我们解决这个问题.

谢谢
Mahesh ..

Hi,

The Excel file is generated through ASP.NET C# Web application. But getting error while opening Excel file with Windows server 2008 R2 and at local Windows XP it is running fine.
Error is "System.Runtime.InteropServices.COMException (0x800A03EC): Exception from HRESULT: 0x800A03EC" we have set same culture settings at IIS server also and we have given permissions also. We are able to save Excel file there but not able to open it.

We are opening the file using the code below:

xlWorkBook = xlApp.Workbooks.Open(strExcelPath, 0, true, 5, "", "", false, Excel.XlPlatform.xlWindows, "",false, false, 0, true, false, false);

I request please help us with this issue.

Thanks
Mahesh..

推荐答案

幸运的是,我在CP中找到了这个

System.Runtime.InteropServices.COMException:来自HRESULT的异常:0x800A03EC [ ^ ]


可能您需要设置权限.在这里,您单击 [
Fortunately I found this one in CP

System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x800A03EC[^]


Possibly you need to set permissons. Here you go Click[^]
[/Edit]


请通过以下链接...似乎有些DCOM配置相关问题

http://social.msdn.microsoft.com/Forums/zh/Vsexpressvb/thread/b6388275-b295-4e55-8c25-6d8788eac1ca [
Please go through the following link...seems some DCOM config related issue

http://social.msdn.microsoft.com/Forums/en/Vsexpressvb/thread/b6388275-b295-4e55-8c25-6d8788eac1ca[^]


这篇关于无法在AP.NET C#应用程序中打开生成的Excel文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆