If you add a reference to Microsoft Excel and then try to use it within your ASP.NET application you may receive the following error.
Server Error in '/excel' Application.
Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005.
Example Application

The problem is that by default Microsoft Excel as a COM object can only activated by the following accounts:
- Administrator
- System
- Interactive
When you are running your ASP.Net account on Windows XP your web application is running as the ASPNET account.
The way to resolve this issue is to edit the DCOM configuration settings for the Microsoft Excel Application object.
Configure DCOM
Note: Remember if you are running on Windows 2003 Server you must use the application pool identity as the account and not the ASPNET account.