Home » excel » asp.net – error while creating excel file in c# webapplication

asp.net – error while creating excel file in c# webapplication

Posted by: admin April 23, 2020 Leave a comment


i am getting following error while creating the excel file

Retrieving the COM class factory for
component with CLSID
failed due to the following error:
80070005 Access is denied. (Exception
from HRESULT: 0x80070005
QA.CreateExcel.createDoc() in

i am using this code.

private Office.Excel.Application app =new Office.Excel.Application();

m using fw 4.0 and its a webapplication

How to&Answers:

Office 2007/2010 file formats are XML files wrapped inside of zips and can be created server-side without needing Office installed. Some searching online will reveal solutions for simplifying the task of doing so.

For example, Codeplex has a project that makes doing so almost as easy as automating Excel, but with none of the issues you are encountering.



Well, install Excel on the server and give IIS the rights to use it. This will not be stable, and chances are that your hosting provider won’t even let you (unless you are hosting it on your own servers). This would also cost you an Office license..

Microsoft advises against installing Office on servers because of stability and reliability issues. http://support.microsoft.com/kb/257757 focusses on some of these problems and also mentions some alternatives.