开发者

COM class factory 80040154 server error

I wasn't getting this error before on localhost, but now it's occurring when I uploaded my ASP.NET C# web app to the server. I've been looking for an answer how to fix this, but cannot seem to get rid of it. I have a Microsoft.Office.Interop.Excel DLL which I am trying to use to export data from a dataset to excel. I was told by customer service that the domain that I have registered is hosted on a 32-bit server. Please help!

Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due开发者_如何学运维 to the following error: 80040154.

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 {00024500-0000-0000-C000-000000000046} failed due to the following error: 80040154.

Source Error:

Line 499:            object misValue = System.Reflection.Missing.Value;
Line 500:
Line 501:            xlApp = new Excel.ApplicationClass();
Line 502:            xlWorkBook = xlApp.Workbooks.Add(misValue);
Line 503:            xlWorkSheet = (Excel.Worksheet)xlWorkBook.Worksheets.get_Item(1);


Look at http://support.microsoft.com/kb/897646
Article ID: 897646 - Last Review: January 5, 2006 - Revision: 1.10
Office 2003 Update: Redistributable Primary Interop Assemblies is available for download
Step 1.- Install Office 2003
Step 2.- Install SP Office
Step 3.- Install O2003PIA components


There a guy describing step by step how to solve you problem here


If the other solution doesn't work try adding the following to the web.config after

<identity impersonate="true" userName="******" password="*******"/>

Replacing the * with a valid Windows username and password that would have access to Excel. Make sure you login as the identity you are impersonating so you can verify that it has access to Excel (Office 2010 tends to want to reactivate Office for each user I've noticed).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜