Click to See Complete Forum and Search --> : InteropServices.COMException Error


funniest
November 10th, 2005, 04:13 PM
Here's a problem that I'm facing, any suggestions appreciated.

I have an ASP web application which exports data to Excel. The application has reference to Interop.Excel.dll and can run on several computers.
However, when it runs on the main server, it can only create an Excel application object, then any accesses to the object's components would cause the InteropServices.ComException.

I can see the EXCEL.EXE runing as a process, but the COM components are inaccessible.

I already tried to run dcomcnf to set permission for Excel application on the server, and set permission for aspnet user on the app folder as well.

Thanks in advance for any helps

Igor Soukhov
November 11th, 2005, 07:50 AM
Here's a problem that I'm facing, any suggestions appreciated.

I have an ASP web application which exports data to Excel. The application has reference to Interop.Excel.dll and can run on several computers.
However, when it runs on the main server, it can only create an Excel application object, then any accesses to the object's components would cause the InteropServices.ComException.

I can see the EXCEL.EXE runing as a process, but the COM components are inaccessible.

I already tried to run dcomcnf to set permission for Excel application on the server, and set permission for aspnet user on the app folder as well.

Thanks in advance for any helps

To find out what exactly is going wrong, check ErrorCode (that's the COM error code - HRESULT) and Message properties of caught exception.

funniest
November 11th, 2005, 10:57 AM
Using the debug mode, I can see all the properties on excel object are like:
<error: an exception of type: {System.Runtime.InteropServices.COMException} occurred> Boolean

The error description is:
"-2147417851: The server threw an exception"