惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
SegmentFault 最新的问题
爱范儿
爱范儿
博客园 - Franky
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
WordPress大学
WordPress大学
宝玉的分享
宝玉的分享
雷峰网
雷峰网
酷 壳 – CoolShell
酷 壳 – CoolShell
IT之家
IT之家
有赞技术团队
有赞技术团队
美团技术团队
Last Week in AI
Last Week in AI
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
大猫的无限游戏
大猫的无限游戏
The Cloudflare Blog
Jina AI
Jina AI
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Engineering at Meta
Engineering at Meta
T
Tailwind CSS Blog
J
Java Code Geeks
Martin Fowler
Martin Fowler
I
InfoQ
小众软件
小众软件
MongoDB | Blog
MongoDB | Blog

博客园 - xh3

关于cookieless="true"与website.map冲突的一个问题! - xh3 - 博客园 关于AJAX.net的一个问题:回发或回调参数无效! - xh3 - 博客园 在Asp.net 2.0中用QueryString传递中文参数的解决方法! - xh3 - 博客园 在Asp.net 2.0 中禁用页面缓存解决页面刷新(重新加载数据)的问题! 在Asp.net 2.0中关于menu和treeview的几点使用注意! - xh3 - 博客园 Asp.net 2.0 中 Cache 丢失的问题:“值不能为空”或“未将对象引用设置到对象的实例” 在Asp.net2.0中建立Microsoft.Office.Interop.Word.Application时出现“拒绝访问”错误的解决方法 经典英语口语228句(下) 经典英语口语228句(上) return confirm() 失效的一个解决方法! - xh3 ora-12154 TNS:"无法处理服务名"的一个解决方法 AJAX.NET 1.0 "Sys未定义" 解决方法 - xh3 AJAX.NET 1.0 Configuration Error 解决方法 如何在GridView中通过超级链接列打开服务器上的文档? - xh3 - 博客园 GridViewRow可以任意位置单击引发事件的方法! 如何在GridView中使用RadioButtons单选列! ASP.NET程序常用代码 - xh3 - 博客园 Windows XP系统优化简单实用版 Windows XP 常见进程列表
Asp.net 2.0在Windows 2003 Server 上配置Microsoft Excel、M...
xh3 · 2007-08-06 · via 博客园 - xh3

Server Error in '/' Application.
--------------------------------------------------------------------------------

Retrieving the COM 
class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 8000401a. 
Description: 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. 

Exception Details: System.Runtime.InteropServices.COMException: Retrieving the COM 
class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 8000401a.

Source Error: 


Line 
175:       
Line 
176:        //创建一个名为WordApp的组件对象
Line 177:        Word.Application WordApp = new Word.ApplicationClass();
Line 
178:        //创建一个名为WordDoc的文档对象
Line 179:        Word.Document WordDoc = WordApp.Documents.Add(ref Nothing, ref Nothing, ref Nothing, ref Nothing);
 


Stack Trace: 


[COMException (
0x8000401a): Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 8000401a.]
   SafetyTrainingManagement_TrainingManagement_CertificationTraining_TrainingTaskReleaseAdd.btnSubmit_Click(Object sender, EventArgs e) 
in d:\AffairProject\SafetyTrainingManagement\TrainingManagement\CertificationTraining\TrainingTaskReleaseAdd.aspx.cs:177
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) 
+105
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) 
+107
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) 
+7
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) 
+11
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) 
+33
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) 
+5102

 


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:
2.0.50727.832; ASP.NET Version:2.0.50727.832 

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

最后找到解决方案:

运行dcomcnfg打开组件服务,

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

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

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

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

点击"安全"选项卡,

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

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

OK,解决此问题!