Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
542 views
in Technique[技术] by (71.8m points)

c# - System.UnauthorizedAccessException: Retrieving the COM class factory for Word Interop fails with error 80070005

I have a problem with a C# ASP .NET project in Visual Studio 2008 This problem started when I reinstalled my computer with Windows 7 Ultimate (x64). To this I'm also using Office 2007.

The error message I'm getting is:

System.UnauthorizedAccessException: Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80070005. at xxx.Utility.WordDocument..ctor(String filePath, HttpServerUtility util) at customer_communication.BuCreate_click(Object sender, EventArgs e) in c:xxxWebsitecustomercommunication.aspx.cs:line 127

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Here is my fix for this problem:

I'm using Win 7 64bit and Office 2007

Run program "dcomcnfg -32". ( You cant find the word and excel components if it runs under 64bit)

Go to "Console Root/Component Services/Computer/My Computer/DCOM Config/" Look up Microsoft Word and Excel and choose properties.

Go to Security and select "Customize" under "Configuration Permissions. (If needed you might want to change the other permissions as well, but I didn't need to) Add "IIS_IUSRS" and give it "Full Control".

Now go to "Identity" and select "The interactive user".

Do not forget to press "OK" when done. :D

I Hope this helps you with your problem and also the rest who gets here and read this.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...