I have a asp.net/c# web application when i try to create the following
excel object using the following code mentioned below
I have Office 2003 installed on my PC, VS.Net 2003. but still it gives the
following
error.
I get the error
COM object with CLSID {00024500-0000-0000-C000-000000000046} is either not
valid or not registered.
Sample Code of my Web Application
Expand|Select|Wrap|Line Numbers
- using Excel=Microsoft.Office.Interop.Excel;
- Excel.Application excelApp = null;
- try
- {
- // Instantiate Excel and start a new workbook.
- excelApp = new Excel.ApplicationClass();
- }
- catch( Exception theException )
- {
- String errorMessage;
- errorMessage = "SM Error: ";
- errorMessage = String.Concat( errorMessage, theException.Message );
- errorMessage = String.Concat( errorMessage, " Line: " );
- errorMessage = String.Concat( errorMessage, theException.Source );
- Response.Write( errorMessage);
- }
In the Component Services - > Dcom Config ->
Microsoft Excel Application object & {000C101C-0000-0000-C000-000000000046}
object
I have the following settings
On the General Tab
Authentication level is default
On the Security Tab
I have Given the the Lauch & Access Permissions for the following Users
System, Interactive, EveryOne, Administrators, IUSR_XX, IWAM_XX, ASPNET,
& the
User with which i logon on to the System.
On the Identity Tab
For Excel Application object - I have Selected "The Launching User" radio
option
For {000C101C-0000-0000-C000-000000000046} object - I have selected "The
System Account (services only)" radio option
With these settings when i launch the Excel using a WinForm C# application
it works fine but not for the web application.
Kindly let me know if you have any suggestions/ideas
Regards,
Prasad