我刚刚创建了一个简单的应用程序,并托管在IIS6.0中.在代码中,我只是实例化Excel对象.
using excel = Microsoft.Office.Interop.Excel.Application;
namespace TestHosting
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
excel excelObj=new Microsoft.Office.Interop.Excel.Application();
}
}
}
它给了我以下错误
"Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied." (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).
系统配置:
Windows server 2008,enterprise edition with 64 bit.
我try 了在网上找到的许多可能的解决方案,但没有一个对我有效.
下面是我try 过一些解决方案
1) creating Desktop application under the path "C:\Windows\SysWOW64\config\systemprofile" 2)setting full permission/control for Microsfot.EXcelApplicaiton in DCOMCNFG 3)Killing all excel instances in Task Manager个
请在这方面帮助我,这只是一个示例应用程序,但在我的原始应用程序主要是关于读写数据从/到EXCEL.