Asp.net 2.0在Windows 2003 Server 上配置Microsoft Excel、Microsoft Word应用程序权限时 error: 8000401a...

ASP.NET 2.0 Excel Word 权限错误解决
本文解决ASP.NET 2.0环境下配置Microsoft Excel和Microsoft Word时出现的8000401a错误。通过调整DCOM配置中组件的安全设置,包括启动和激活权限、访问权限及配置权限,成功解决了该问题。

Asp.net 2.0在Windows 2003 Server 上配置Microsoft Excel、Microsoft Word应用程序权限时 error: 8000401a 的解决方法!

 

None.gifServer Error in '/' Application.
None.gif
--------------------------------------------------------------------------------
None.gif
ExpandedBlockStart.gifContractedBlock.gifRetrieving the COM 
class factory for component with CLSID dot.gif{000209FF-0000-0000-C000-000000000046} failed due to the following error: 8000401a. 
None.gifDescription: An unhandled exception occurred during the execution of the current web request. Please review the stack trace 
for more information about the error and where it originated in the code. 
None.gif
ExpandedBlockStart.gifContractedBlock.gifException Details: System.Runtime.InteropServices.COMException: Retrieving the COM 
class factory for component with CLSID dot.gif{000209FF-0000-0000-C000-000000000046} failed due to the following error: 8000401a.
None.gif
None.gifSource Error: 
None.gif
None.gif
None.gifLine 
175:       
None.gifLine 
176:        //创建一个名为WordApp的组件对象
None.gif
Line 177:        Word.Application WordApp = new Word.ApplicationClass();
None.gifLine 
178:        //创建一个名为WordDoc的文档对象
None.gif
Line 179:        Word.Document WordDoc = WordApp.Documents.Add(ref Nothing, ref Nothing, ref Nothing, ref Nothing);
None.gif 
None.gif
None.gif
None.gifStack Trace: 
None.gif
None.gif
ExpandedBlockStart.gifContractedBlock.gif[COMException (
0x8000401a): Retrieving the COM class factory for component with CLSID dot.gif{000209FF-0000-0000-C000-000000000046} failed due to the following error: 8000401a.]
None.gif   SafetyTrainingManagement_TrainingManagement_CertificationTraining_TrainingTaskReleaseAdd.btnSubmit_Click(Object sender, EventArgs e) 
in d:\AffairProject\SafetyTrainingManagement\TrainingManagement\CertificationTraining\TrainingTaskReleaseAdd.aspx.cs:177
None.gif   System.Web.UI.WebControls.Button.OnClick(EventArgs e) 
+105
None.gif   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) 
+107
None.gif   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) 
+7
None.gif   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) 
+11
None.gif   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) 
+33
None.gif   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) 
+5102
None.gif
None.gif 
None.gif
None.gif
None.gif
--------------------------------------------------------------------------------
None.gifVersion Information: Microsoft .NET Framework Version:
2.0.50727.832; ASP.NET Version:2.0.50727.832 



这个问题困扰了我很久,在网上找了很多资料都没用,

最后找到解决方案:

运行dcomcnfg打开组件服务,

依次展开"组件服务"->"计算机"->"我的电脑"->"DCOM配置"

找到"Microsoft Excel应用程序"或"Microsoft Word应用程序",

右键打开属性对话框,点击"标识"选项卡,

点"下列用户",把管理员的用户密码正确填写进去...??

    实测发现:选择"启动用户"也可以解决问题,填入管理员的帐号和密码不现实

点击"安全"选项卡,

依次把"启动和激活权限","访问权限","配置权限",都选择为自定义,

然后依次点击它们的编辑,把everyone添加进去,并加入所有的权限...

OK,解决此问题!

转载于:https://www.cnblogs.com/rexying/archive/2008/01/26/1054305.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值