i am getting following error while creating the excel file
System.UnauthorizedAccessException: Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)). at QA.CreateExcel.createDoc() in e:\~~CreateExcel.cs:line 33
i am using this code.
private Office.Excel.Application app =new Office.Excel.Application();
m using fw 4.0 and its a webapplication
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.
http://www.codeproject.com/KB/office/ExcelPackage.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With