Many people use it in the Development EnvironmentMicrosoft. Office. InterOP. Word orMicrosoft. Office. InterOP. EXCEL program and run successfully. If you deploy the program on IIS or website server, you will usually receive this error:
"An error occurred while retrieving components whose CLSID is {00024500-0000-0000-c000-000000000046} in the com class factory because the following error occurs: 8000401a"
Or"Retrieving components whose CLSID is {000209ff-0000-0000-c000-000000000046} in the com class factory fails because of the following error: 80070005 ."
In this case, you can only install the Office on the server and configure the DCOM permission. For details, see:Http://www.cnblogs.com/downmoon/archive/2009/01/16/1376702.html
It is quite troublesome, and the installation of office on the server itself is quite different. If it is a hosted or rented server, it will be even worse.
In fact, I have made similar mistakes before. Later, I found that many people are still taking the same path as me, so I wrote this article to avoid detours for other beginners.
ReasonableSolutionIs to use independent third-party components, the advantage of doing so isIt is irrelevant to the server configuration.
Word:
1. aspose. Word, one of the components, is commercial software that supports. Net (C #/VB.net) and Java
Official station: http://www.aspose.com/categories/product-family-packs/aspose.total-product-family/default.aspx
2. officewriter is also a commercial software.
Site: http://www.officewriter.com/
Please let me know who found free open-source components. Thank you! Of course, this is mainly for versions earlier than Office 2003. offcie 2007 has replaced binary data storage in XML format.
Excel related:
1. npoi, an open-source and free powerful Excel component.
Http://npoi.codeplex.com/
Http://www.cnblogs.com/tonyqus/archive/2009/03/16/1409966.html
Application Example: http://www.cnblogs.com/downmoon/archive/2011/04/16/2017603.html
2. myxls,Open-source and free powerful Excel components.
Http://sourceforge.net/projects/myxls/files/MyXls/
Application Example: http://www.cnblogs.com/downmoon/archive/2011/05/30/2063258.html